當前位置:首頁 » 幣種行情 » 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用戶

熱點內容
調研組在調研btc天 發布:2025-05-18 04:19:18 瀏覽:556
數字貨幣ddm是什麼意思 發布:2025-05-18 04:14:59 瀏覽:266
怎麼算摩擦力的能量 發布:2025-05-18 04:13:26 瀏覽:694
幣印礦池dcr算力驟減 發布:2025-05-18 04:11:52 瀏覽:646
虛擬貨幣唯有茅台和比特幣 發布:2025-05-18 03:56:07 瀏覽:944
比特幣挖礦不是浪費錢 發布:2025-05-18 03:51:32 瀏覽:403
usdt如何賣出人民幣 發布:2025-05-18 03:43:08 瀏覽:417
元宇宙區塊鏈代幣yyz 發布:2025-05-18 03:42:28 瀏覽:419
測繪次新元宇宙 發布:2025-05-18 02:37:55 瀏覽:970
比特幣轉讓幣手續 發布:2025-05-18 02:37:53 瀏覽:204