当前位置:首页 » 币种行情 » centos65eth0

centos65eth0

发布时间: 2022-03-22 21:55:26

『壹』 如何使用PXE自动安装Linux

操作步骤:

一,配置DHCP

1,安装dhcpd
yum install dhcp

2,修改dhcp配置文件/etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.202.0 netmask 255.255.255.0 {
range 192.168.202.200 192.168.202.220;
option routers 192.168.202.131;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.202.131;
filename "pxelinux.0";
}

3,启动dhcpd
chkconfig --add dhcpd
service dhcpd start

使用命令可以看到dhcpd绑定了多个端口
[root@localhost init.d]# netstat -anp | grep dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 3266/dhcpd
raw 0 0 0.0.0.0:1 0.0.0.0:* 7 3266/dhcpd
unix 2 [ ] DGRAM 18034 3266/dhcpd
注意:第2行raw表示绑定在ICMP协议上,协议号为1

二,配置TFTP

4,安装TFTP
yum install tftp-server

5,修改tftpd配置文件/etc/xinetd.d/tftp,ftp根目录为/var/lib/tftpboot
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

6,启动tftp服务(端口69)
/etc/init.d/xinetd restart

三,配置引导内核

7,下载pxe引导配置文件
yum install syslinux
cp `rpm -ql syslinux | grep '/pxelinux.0'` /var/lib/tftpboot

8,拷贝网络启动的内核文件
cp /media/CentOS_6.4_Final/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /media/CentOS_6.4_Final/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

修改default文件:

default linux
prompt 1
timeout 60

display boot.msg

menu background splash.jpg
menu title Welcome to CentOS 6.4!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=http://192.168.202.131/ks.cfg initrd=initrd.img

四,配置kickstart

9,安装nginx,根目录/usr/local/nginx/html
yum install nginx
chkconfig --add nginx
service nginx start

10,拷贝操作系统源文件
mkdir /usr/local/nginx/html/dvd
cp -R /media/CentOS_6.4_Final/* /usr/local/nginx/html/dvd/

11,下载kickstart
yum install system-config-kickstart
cp /root/anaconda-ks.cfg /usr/local/nginx/html/ks.cfg
chmod 755 /usr/local/nginx/html/ks.cfg (不分配权限,外部无法通过http访问,会报403)

修改ks.cfg:
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL

# Firewall configuration
firewall --disabled

# Install OS instead of upgrade
install

# Use text install
text

# Use network installation
url --url="http://192.168.202.131/dvd"

# Root password
rootpw --iscrypted $1$.IvWB.Gl$E4fI4Ez4Z8HyHRCZW5Btr0

# System authorization information
auth --useshadow --passalgo=sha512

# Run the Setup Agent on first boot
firstboot --reconfig

# System keyboard
keyboard us

# System language
lang zh_CN.UTF-8

# SELinux configuration
selinux --enforcing

# Installation logging level
logging --level=info

# System timezone
timezone Asia/Shanghai

# Network information
network --bootproto=dhcp --device=eth0 --onboot=yes

# System bootloader configuration
bootloader --location=mbr

# Clear the Master Boot Record
zerombr

# Partition clearing information
clearpart --all

# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=1000
part / --fstype="ext4" --grow --size=1

# Reboot after installation
reboot

%packages
@base
@core
gcc
%end

五,验证

12,修改CentOS65虚拟配置文件CentOS65.vmx,增加一行bios.bootDelay= "10000",即表示在启动bios的时候停留10秒(否则你根本来不及按任何键的)
给CentOS65加电(打开Power),按Esc选择从Network启动

『贰』 centos eth0 设置怎么生效

输入 setup 图形化配置个eth0的各项
然后 ifup eth0 启动网卡
ifconfig 查看是不是有了eth0了

『叁』 怎么删除centos eth0 修改

vi /etc/udev/rules.d/70-persistent-net.rules 把eth0 改成 eth1 把配置文件 /etc/sysconfig/network-scripts/ifcfg-eth0 改成ifcfg-eth1 重启

『肆』 centos 6.x iptables DNAT失败

做端口转发要写两条规,规则如下:
iptables -t nat -A PREROUTING -d 60.0.0.3 -p tcp -m tcp --dport 8000 -j DNAT --to-destination 192.168.2.101:8080

iptables -t nat -A POSTROUTING -d 192.168.2.101 -p tcp -m tcp --dport 8080 -j SNAT --to 60.0.0.3

『伍』 centos怎么更改ipifconfig

查看IP地址

1
登陆连接centos系统,输入 ifconfig 可以查看到当前本机的IP地址信息,如下图

END
临时设置IP地址

1
如本机为例,上面查询IP为1.117,输入 ifconfig eth0 (默认是第一个网卡) 后面接IP地址, 网络掩码和 网关,如果不设置,就使用默认的掩码

2
再次查看IP就已经变成新的IP地址了
注意这种方法修改只是临时修改,重启网卡或服务器后又会还原

END
设置\修改IP地址

1
如果要让IP地址永久生效,需要编辑网卡配置文件
使用VI编辑器设置,如 vi /etc/sysconfig/network-scripts/ifcfg-eth0

2
说明一下这个文件;DEVICE=eth0 网卡对应的设备别名,如ifcfg-eth0第一块网卡 BOOTPROTO=static
网卡获得ip地址的方式,
Static(静态 ip地址)
dhcp(通过dhcp协议获取ip)
bootip通过bootp协议获得的ip地址 BROADCAST=192.168.0.255 子网广播地址 HWADDR=00:50:56:8E:47:EE 网卡物理地址 IPADDR=12.168.1.117 网卡IP地址
IPV6INIT=no 是否启用IPV6IPV6_AUTOCONF=no NETMASK=255.255.255.0 网
卡对应网络掩码 NETWORK=192.168.1.0 网卡对应的网络地
址 ONBOOT=yes 系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备。默认设置
为yes
至于后面的 TYPE 和UUID这个就不用管了,这网卡的类型
3
2.使用vi编辑器, 按 insert键插入,进入编辑模式

4
3.将光标移动到 IPADDR 设置部分,改成需要设置的IP地址,
如本例中改成 1.118. 按下esc 键。
输入 冒号:wq 保存退出
会提示 "/etc/sysconfig/network-scripts/ifcfg-eth0" 14L, 302C written

5
4. 设置好之后,把网络服务重启一下,如下图2个命令均可以 service network restart

6
5.再次查看IP你会发现已经改成新的IP地址 1.118了
END
图形界面操作

除此之外,
您可以可以在图形界面操作。编辑网卡设置, 或者使用 netconfig命令进入图形界面设置

2
设置之后,如果需要IP生效。同样需要重启网络服务,或者重启电脑

『陆』 如何使用PXE自动安装linux

操作步骤:

一,配置DHCP

1,安装dhcpd
yum install dhcp

2,修改dhcp配置文件/etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.202.0 netmask 255.255.255.0 {
range 192.168.202.200 192.168.202.220;
option routers 192.168.202.131;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.202.131;
filename "pxelinux.0";
}

3,启动dhcpd
chkconfig --add dhcpd
service dhcpd start

使用命令可以看到dhcpd绑定了多个端口
[root@localhost init.d]# netstat -anp | grep dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 3266/dhcpd
raw 0 0 0.0.0.0:1 0.0.0.0:* 7 3266/dhcpd
unix 2 [ ] DGRAM 18034 3266/dhcpd
注意:第2行raw表示绑定在ICMP协议上,协议号为1

二,配置TFTP

4,安装TFTP
yum install tftp-server

5,修改tftpd配置文件/etc/xinetd.d/tftp,ftp根目录为/var/lib/tftpboot
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

6,启动tftp服务(端口69)
/etc/init.d/xinetd restart

三,配置引导内核

7,下载pxe引导配置文件
yum install syslinux
cp `rpm -ql syslinux | grep '/pxelinux.0'` /var/lib/tftpboot

8,拷贝网络启动的内核文件
cp /media/CentOS_6.4_Final/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /media/CentOS_6.4_Final/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

修改default文件:

default linux
prompt 1
timeout 60

display boot.msg

menu background splash.jpg
menu title Welcome to CentOS 6.4!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=http://192.168.202.131/ks.cfg initrd=initrd.img

四,配置kickstart

9,安装nginx,根目录/usr/local/nginx/html
yum install nginx
chkconfig --add nginx
service nginx start

10,拷贝操作系统源文件
mkdir /usr/local/nginx/html/dvd
cp -R /media/CentOS_6.4_Final/* /usr/local/nginx/html/dvd/

11,下载kickstart
yum install system-config-kickstart
cp /root/anaconda-ks.cfg /usr/local/nginx/html/ks.cfg
chmod 755 /usr/local/nginx/html/ks.cfg (不分配权限,外部无法通过http访问,会报403)

修改ks.cfg:
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL

# Firewall configuration
firewall --disabled

# Install OS instead of upgrade
install

# Use text install
text

# Use network installation
url --url="http://192.168.202.131/dvd"

# Root password
rootpw --iscrypted $1$.IvWB.Gl$E4fI4Ez4Z8HyHRCZW5Btr0

# System authorization information
auth --useshadow --passalgo=sha512

# Run the Setup Agent on first boot
firstboot --reconfig

# System keyboard
keyboard us

# System language
lang zh_CN.UTF-8

# SELinux configuration
selinux --enforcing

# Installation logging level
logging --level=info

# System timezone
timezone Asia/Shanghai

# Network information
network --bootproto=dhcp --device=eth0 --onboot=yes

# System bootloader configuration
bootloader --location=mbr

# Clear the Master Boot Record
zerombr

# Partition clearing information
clearpart --all

# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=1000
part / --fstype="ext4" --grow --size=1

# Reboot after installation
reboot

%packages
@base
@core
gcc
%end

五,验证

12,修改CentOS65虚拟配置文件CentOS65.vmx,增加一行bios.bootDelay= "10000",即表示在启动bios的时候停留10秒(否则你根本来不及按任何键的)
给CentOS65加电(打开Power),按Esc选择从Network启动

『柒』 如何使用PXE自动安装linux

最近公司里要搞自动安装,我就研究了pxe,也从网上参考了不少资料,这里做了一些简单的整理,文字表达功底比较有限,大家别拍砖啊,呵呵
准备:
1,在VMware中安装了一个CentOS63(CentOS6.4系统,IP : 192.168.202.131)
2,在VMware中创建了一个CentOS65(空机器,未装操作系统)
3,CentOS镜像文件挂载在CentOS63的/media/CentOS_6.4_Final位置

操作步骤:

一,配置DHCP

1,安装dhcpd
yum install dhcp

2,修改dhcp配置文件/etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.202.0 netmask 255.255.255.0 {
range 192.168.202.200 192.168.202.220;
option routers 192.168.202.131;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.202.131;
filename "pxelinux.0";
}

3,启动dhcpd
chkconfig --add dhcpd
service dhcpd start

使用命令可以看到dhcpd绑定了多个端口
[root@localhost init.d]# netstat -anp | grep dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 3266/dhcpd
raw 0 0 0.0.0.0:1 0.0.0.0:* 7 3266/dhcpd
unix 2 [ ] DGRAM 18034 3266/dhcpd
注意:第2行raw表示绑定在ICMP协议上,协议号为1

二,配置TFTP

4,安装TFTP
yum install tftp-server

5,修改tftpd配置文件/etc/xinetd.d/tftp,ftp根目录为/var/lib/tftpboot
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

6,启动tftp服务(端口69)
/etc/init.d/xinetd restart

三,配置引导内核

7,下载pxe引导配置文件
yum install syslinux
cp `rpm -ql syslinux | grep '/pxelinux.0'` /var/lib/tftpboot

8,拷贝网络启动的内核文件
cp /media/CentOS_6.4_Final/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /media/CentOS_6.4_Final/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

修改default文件:

default linux
prompt 1
timeout 60

display boot.msg

menu background splash.jpg
menu title Welcome to CentOS 6.4!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=http://192.168.202.131/ks.cfg initrd=initrd.img

四,配置kickstart

9,安装nginx,根目录/usr/local/nginx/html
yum install nginx
chkconfig --add nginx
service nginx start

10,拷贝操作系统源文件
mkdir /usr/local/nginx/html/dvd
cp -R /media/CentOS_6.4_Final/* /usr/local/nginx/html/dvd/

11,下载kickstart
yum install system-config-kickstart
cp /root/anaconda-ks.cfg /usr/local/nginx/html/ks.cfg
chmod 755 /usr/local/nginx/html/ks.cfg (不分配权限,外部无法通过http访问,会报403)

修改ks.cfg:
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL

# Firewall configuration
firewall --disabled

# Install OS instead of upgrade
install

# Use text install
text

# Use network installation
url --url="http://192.168.202.131/dvd"

# Root password
rootpw --iscrypted $1$.IvWB.Gl$E4fI4Ez4Z8HyHRCZW5Btr0

# System authorization information
auth --useshadow --passalgo=sha512

# Run the Setup Agent on first boot
firstboot --reconfig

# System keyboard
keyboard us

# System language
lang zh_CN.UTF-8

# SELinux configuration
selinux --enforcing

# Installation logging level
logging --level=info

# System timezone
timezone Asia/Shanghai

# Network information
network --bootproto=dhcp --device=eth0 --onboot=yes

# System bootloader configuration
bootloader --location=mbr

# Clear the Master Boot Record
zerombr

# Partition clearing information
clearpart --all

# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=1000
part / --fstype="ext4" --grow --size=1

# Reboot after installation
reboot

%packages
@base
@core
gcc
%end

五,验证

12,修改CentOS65虚拟配置文件CentOS65.vmx,增加一行bios.bootDelay= "10000",即表示在启动bios的时候停留10秒(否则你根本来不及按任何键的)
给CentOS65加电(打开Power),按Esc选择从Network启动

『捌』 centos7eth0怎么修改地址

直接vi ifcfg-eth0进去修改就可以啦~!

『玖』 求SAS软件9.4版64位可用的sid文件

相信大家第一次接触 Oracle 数据库时,大多数是在 windows 环境下安装,方便快捷,基本上可以说是一直下一步就能顺利安装成功。然而企业级的数据库,基本上都是安装在 Linux 服务器上,安全且高效。

没接触过在 Linux 环境下安装 Oracle 数据库的朋友也不用怕,跟着本篇文章一步步操作也能搭建成功。

下面我就来手把手教大家如何在 Linux 上部署 Oracle 数据库。

一、前期准备

1、虚拟机安装

Windows 主机推荐虚拟机:VMware Workstation

下载地址:
https://www.vmware.com/go/getworkstation-win

MacOS 主机推荐虚拟机:Parallels Desktop 16 for Mac

下载地址:
https://www.parallels.cn/procts/desktop/trial/

2、Oracle软件安装包

oracle 官网下载地址:
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

3、Linux系统安装包

一般有三种Linux系统比较常用:RedHat、OracleLinux、Centos。


  • RedHat下载:

  • https://developers.redhat.com/procts/rhel/download

  • OracleLinux下载:

  • https://yum.oracle.com/oracle-linux-isos.html

  • Centos下载:

  • https://vault.centos.org/

  • Linux系统安装详情可参考:

  • 教你三步在 MacOS 上安装 Linux 系统:

  • https://blog.csdn.net/m0_50546016/article/details/117414290



  • Windows 主机如何玩转虚拟机 Linux 安装:

  • https://blog.csdn.net/m0_50546016/article/details/117415206

  • 4、Linux 远程连接工具

    本文将使用 XShell 和 Xftp 工具;

    通过 RedHat Linux 7.6 版本安装 Oracle 11GR2 版本数据库。

    主机内存 2G,硬盘 50G 即可。

    二、Linux主机配置

    使用 XShell 工具连接 Linux 主机 root 用户:

    1、主机名配置

    如果安装时没有配置主机名,或者想要修改主机名,可以通过以下命令修改:

    hostnamectl set-hostname orcl

    2、网络配置

    如果安装时没有配置网络,或者想要修改网络,可以通过以下命令修改:

    nmcli connection modify eth0 ipv4.addresses 10.211.55.188/24 ipv4.gateway 10.211.55.1 ipv4.method manual autoconnect yes
    nmcli connection up eth0

    3、配置Hosts文件

    根据上面配置好的主机名和IP,配置hosts文件:

    cat <

    >/etc/hosts
    ##OracleBegin##
    ##Public IP
    10.211.55.188 orcl
    ##OracleEnd##
    EOF

    4、防火墙配置

    systemctl stop firewalld
    systemctl disable firewalld

    5、Selinux配置

    selinux修改后需要重启主机生效:

    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

    6、ISO镜像源配置

    需要先挂载主机镜像:

    Parallels Desktop挂载Linux主机镜像:

    VMware Workstation挂载Linux镜像:

    mount /dev/cdrom /mnt
    cat <

    /etc/yum.repos.d/local.repo
    [local]
    name=local
    baseurl=file:///mnt
    gpgcheck=0
    enabled=1
    EOF

    7、安装Oracle依赖包

    如下依赖包从Oracle官方文档推荐获取:

    yum install -y bc
    binutils
    compat-libcap1
    compat-libstdc++-33
    gcc
    gcc-c++
    elfutils-libelf
    elfutils-libelf-devel
    glibc
    glibc-devel
    ksh
    lio
    lio-devel
    libgcc
    libstdc++
    libstdc++-devel
    libxcb
    libX11
    libXau
    libXi
    libXtst
    libXrender
    libXrender-devel
    make
    net-tools
    nfs-utils
    smartmontools
    sysstat
    e2fsprogs
    e2fsprogs-libs
    fontconfig-devel
    expect
    unzip
    openssh-clients
    readline*
    psmisc --skip-broken

    检查是否安装成功:

    rpm -q bc binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ elfutils-libelf elfutils-libelf-devel glibc glibc-devel ksh lio lio-devel libgcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel make net-tools nfs-utils smartmontools sysstat e2fsprogs e2fsprogs-libs fontconfig-devel expect unzip openssh-clients readline

    Linux7需要手动安装compat-libstdc++依赖包:

    rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

    8、配置ZeroConf

    ##关闭Zeroconf service的服务守护进程
    systemctl stop avahi-daemon.socket
    systemctl stop avahi-daemon.service
    systemctl disable avahi-daemon.service
    systemctl disable avahi-daemon.socket
    ##关闭NOZEROCONF
    cat <

    >/etc/sysconfig/network
    #OracleBegin
    NOZEROCONF=yes
    #OracleEnd
    EOF

    9、关闭透明大页和numa

    sed -i 's/quiet/quiet transparent_hugepage=never numa=off/' /etc/default/grub
    grub2-mkconfig -o /boot/grub2/grub.cfg

    10、配置系统参数文件

    ##计算shmall和shmmax值
    memTotal=$(grep MemTotal /proc/meminfo | awk '{print $2}')
    totalMemory=$((memTotal / 2048))
    shmall=$((memTotal / 4))
    if [ $shmall -lt 2097152 ]; then
    shmall=2097152
    fi
    shmmax=$((memTotal * 1024 - 1))
    if [ "$shmmax" -lt 4294967295 ]; then
    shmmax=4294967295
    fi
    echo $shmall
    echo $shmmax
    ##配置系统参数
    cat <

    >/etc/sysctl.conf
    #OracleBegin
    ##shmmal's Calculation formula: physical memory 8G:(8*1024*1024*1024)/4096=2097152
    ##shmmax's Calculation formula: physical memory 8G:(8/2)*1024*1024*1024 -1=4294967295
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = $shmall
    kernel.shmmax = $shmmax
    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
    EOF
    ##系统参数生效
    sysctl -p

    11、配置系统资源限制

    cat <

    >>/etc/security/limits.conf
    #OracleBegin
    oracle soft nofile 1024
    oracle hard nofile 65536
    oracle soft stack 10240
    oracle hard stack 32768
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle hard memlock 134217728
    oracle soft memlock 134217728
    #OracleEnd
    EOF
    cat <

    >>/etc/pam.d/login
    #OracleBegin
    session required pam_limits.so
    session required /lib64/security/pam_limits.so
    #OracleEnd
    EOF

    12、创建用户和组

    /usr/sbin/groupadd -g 54321 oinstall
    /usr/sbin/groupadd -g 54322 dba
    /usr/sbin/groupadd -g 54323 oper
    /usr/sbin/useradd -u 54321 -g oinstall -G dba,oper oracle
    echo oracle | passwd --stdin oracle

    13、创建Oracle安装目录

    mkdir -p /u01/app/oracle/proct/11.2.0/db
    mkdir -p /u01/app/oraInventory
    mkdir -p /oradata
    chown -R oracle:oinstall /oradata
    chown -R oracle:oinstall /u01/app
    chmod -R 775 /u01/app

    14、配置用户环境变量

    cat <

    >/home/oracle/.bash_profile
    ################OracleBegin#########################
    umask 022
    export TMP=/tmp
    export TMPDIR=$TMP
    export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/proct/11.2.0/db
    export ORACLE_HOSTNAME=orcl
    export ORACLE_TERM=xterm
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export ORACLE_SID=orcl
    export PATH=/usr/sbin:$PATH
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
    alias sas='sqlplus / as sysdba'
    export PS1="[`whoami`@`hostname`:"'$PWD]$ '
    EOF

    三、Oracle软件安装

    1、Oracle软件包上传

    [root@orcl soft]# ll
    -rw-r--r--. 1 root root 1395582860 May 31 16:56 p13390677_112040_Linux-x86-64_1of7.zip
    -rw-r--r--. 1 root root 1151304589 May 31 16:56 p13390677_112040_Linux-x86-64_2of7.zip

    2、解压Oracle软件安装包

    需要按顺序解压1,2安装包:

    cd /soft
    unzip -q p13390677_112040_Linux-x86-64_1of7.zip
    unzip -q p13390677_112040_Linux-x86-64_2of7.zip
    ##授权/soft给oracle读写权限
    chown -R oracle:oinstall /soft

    3、安装VNC软件

    yum install -y tigervnc*
    su - oracle
    vncserver
    ##输入密码

    4、连接VNC远程工具或者直接打开虚拟机图形化界面

    右键打开终端工具:

    进入/soft/database开始安装Oracle软件:

    ./runInstaller -jreLoc /etc/alternatives/jre_1.8.0

    上传pdksh-5.2.14-37.el5.x86_64.rpm依赖包,安装:

    rpm -e ksh-20120801-142.el7.x86_64
    rpm -ivh pdksh-5.2.14-37.el5.x86_64.rpm

    点击再次检查,忽略swap警告:

    解决方案:

    su - oracle
    sed -i 's/^(s*$(MK_EMAGENT_NMECTL))s*$/1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk

    执行完点击retry重试:

    root用户下执行脚本:

    /u01/app/oraInventory/orainstRoot.sh
    /u01/app/oracle/proct/11.2.0/db/root.sh

    reboot重启主机。

    四、创建数据库

    1、打开监听

    su - oracle
    lsnrctl start
    lsnrctl status

    2、连接VNC远程工具或者直接打开虚拟机图形化界面

    dbca

    这里填写数据库实例名称和dbname,本次填写orcl。

    不安装EM工具。

    这里输入SYS和SYSTEM用户的密码,需要记住。

    这里选择前面建好的/oradata目录用来存放数据文件。

    不开启闪回日志,不开启归档日志,可以建好库之后再手动修改。

    数据库内存分配,选择手动分配,占用物理内存70%左右。

    block_size根据实际情况选择,一旦建库无法修改,默认8K。

    字符集根据需要进行选择,默认AL32UTF8。

    等待建库完成即可。

    五、连接数据库

    确保监听正常启动,并监听数据库

    1、通过数据库主机连接

    su - oracle
    sqlplus / as sysdba
    select sysdate from al;
    ##创建数据库用户
    create user test identified by test;
    grant dba to test;
    conn test/test
    ##创建表
    create table test (id number not null,name varchar2(100));
    insert into test values (1,'lucifer');
    commit;

    2、通过PL/SQL连接test用户

热点内容
以太坊280x 发布:2025-07-09 23:18:57 浏览:719
xrp被盗 发布:2025-07-09 23:18:55 浏览:413
btc行情走势年 发布:2025-07-09 23:14:08 浏览:867
币圈下一次牛市热点 发布:2025-07-09 22:56:11 浏览:708
以太坊发行白皮书 发布:2025-07-09 22:47:54 浏览:451
区块链技术开发学习路径 发布:2025-07-09 22:41:01 浏览:13
新晨科技中标银行区块链 发布:2025-07-09 22:38:22 浏览:941
以太坊代币价格 发布:2025-07-09 22:37:14 浏览:172
eth钱包申请视频 发布:2025-07-09 22:27:49 浏览:519
蚂蚁z9mini矿机能挖什么币 发布:2025-07-09 22:09:54 浏览:625