debian 10 安装 oracle 11g-11.2.0.1
https://www.oracle.com/database/technologies/xe18c-downloads.htmlhttps://edelivery.oracle.com/osdc/faces/SoftwareDelivery
debian 10 安装 oracle 11g-11.2.0.1
- 1、写在前面:这篇文章最后安装失败了。这是一次失败的尝试,仅做记录。结论是Debian不支持Oracle数据库安装。后续再尝试吧。
- 1、下载oracle 11g (11.2.0.1.0)
- 2、安装文档
- 3、安装前准备
- 4、安装
- 4.1、直接使用oracle用户进行ssh登录
- 4.2、执行安装程序
- 4.2.1、runInstaller
- 4.2.2、选择安装类型
- 4.2.3、选择服务器安装还是桌面安装
- 4.2.4、选择单实例数据库安装 或者 Real Application Clusters数据库安装
- 4.2.5、选择自定义安装类型
- 4.2.6、选择语言
- 4.2.7、选择Enterprise Edition
- 4.2.8、选择安装目录和数据库目录
- 4.2.9、选择inventory目录
- 4.2.10、选择数据库用途
- 4.2.11、数据库名和实例名
- 4.2.12、内存、字符集、secure、samples
- 4.2.13、选择database control for database management
- 4.2.14、Database Storage 默认选择FileSystem
- 4.2.15、自动备份
- 4.2.16、设置数据库用户密码
- 4.2.17、选择OperatingSystemGroup
- 4.2.18、先决依赖项检查
- 4.2.19、安装概览
- 4.2.20、等待安装完成
- 报错
- 报错
- 报错
- 报错
- 报错
- Check that Oracle is running on Debian
1、写在前面:这篇文章最后安装失败了。这是一次失败的尝试,仅做记录。结论是Debian不支持Oracle数据库安装。后续再尝试吧。
1、下载oracle 11g (11.2.0.1.0)
1.1、Oracle Database 11.2.0.1.0
https://edelivery.oracle.com/osdc/faces/SoftwareDelivery
V17530-01_1of2.zip Oracle Database 11.2.0.1.0 for Linux x86-64, 1.2 GB
SHA-1 8C0236EDA14D12CA1127418815F027A92D8B407E
SHA-256 FF46188AEA66967FFBE1E46A52AC85670A10BC8ACEA78536540C3B00C6D3B5DC
V17530-01_2of2.zip Oracle Database 11.2.0.1.0 for Linux x86-64, 1.0 GB
SHA-1 1DB316053728E4A668B96E00ED771A3E40100021
SHA-256 008DD2F9D45075CEA9CC745FED8A2CE9E42D53AFC91BB8C75E1620BA4B95F33A
V20610-01_1of2.zip Oracle Database 11.2.0.1.0 for Microsoft Windows x64 (64-bit), 1.1 GB
SHA-1 DC3ADE4EB73A2BFDFFAFBC2DED6FB305C33ADF64
SHA-256 6B762AF9825EE84565073322E11E941C61A5B3682DA0B990E76C1C5C918CB347
V20610-01_2of2.zip Oracle Database 11.2.0.1.0 for Microsoft Windows x64 (64-bit), 961.3 MB
SHA-1 A32056B6645AD4E4C9C9E610827D33D60A0DBBF5
SHA-256 7A5C131E48DE5D14FB73E9E89A38A53418777E9359F7930308C256746BA11E2B
1.2、Oracle Database Grid Infrastructure 11.2.0.1.0
V17531-01.zip Oracle Database Grid Infrastructure 11.2.0.1.0 for Linux x86-64, 1004.1 MB
SHA-1 6DE61906675F1ADA3FB43406E021E8D63185137B
SHA-256 698CA21CAA94D58D36F731F235DF06C6BCDF52E6FD32710CD34AEAD6F3404655
V20612-01.zip Oracle Database Grid Infrastructure 11.2.0.1.0 for Microsoft Windows x64 (64-bit), 682.0 MB
SHA-1 088EB893AF91F2CC8E09E4AB381AF8850242B416
SHA-256 187CA19413E638ADA013525B8F4BA9AA6E80B14D59BF3DDB88B2C8C302E91BDF
1.3、客户端
V20609-01.zip Oracle Database Client 11.2.0.1.0 for Microsoft Windows x64 (64-bit), 587.2 MB
SHA-1 6211CE847F39F833635509E5AF410A42501E090C
SHA-256 60063C214CF277A316CF20360F3DE4C7830DA7AA0CA02BC11386EFAA344383F3
V20606-01.zip Oracle Database Client 11.2.0.1.0 for Microsoft Windows (32-bit), 652.9 MB
SHA-1 2D8F8BCA5BC144750C0BFD423A2642FF81755C0B
SHA-256 E50AF6487B3A39E462F2E4D3775C75569665F2ECFFD7D2BF5A3C35C9DA16DC9F
V17532-01.zip Oracle Database Client 11.2.0.1.0 for Linux x86-64, 673.5 MB
SHA-1 0C6320934C79DD303C1CBB775FCD94BE15B9DBDB
SHA-256 6D03E05C0FA3A5F6A0FB6AA75F7B9DCE9E09A31D776516694F7FA6EBCE9BB775
V17488-01.zip Oracle Database Client 11.2.0.1.0 for Linux x86, 612.3 MB
SHA-1 2D41F76D241BBE95828DC7AD53007879BE3C22A8
SHA-256 7F5BC816EC4C6D272DBA2D165E9AA971C47781363954B7986D4634AB4F7653E2
2、安装文档
在debian 上安装
https://www.nakivo.com/blog/how-to-install-oracle-on-ubuntu-linux-waltkhrough/
3、安装前准备
3.1、建立用户和用户组
addgroup --system oinstall
addgroup --system dba
adduser --system --ingroup oinstall --shell /bin/bash oracle
adduser oracle dba
3.2、sysctl
vi /etc/sysctl.conf
插入如下内容
# ============================
# Oracle 11g
# ============================
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmni = 4096
# Replace kernel.shmmax with the half of your memory size in bytes
# if lower than 4 GB minus 1
# 6442450944 is 6 GigaBytes (12 GB of RAM / 2)
kernel.shmmax=6442450944
#
# Max number of network connections. Use sysctl -a | grep ip_local_port_range to check.
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
#
# The maximum allowed value, set to avoid overhead and input/output errors
fs.aio-max-nr = 1048576
# 512 * Processes
fs.file-max = 6815744
fs.suid_dumpable = 1
#
# To allow dba to allocate hugetlbfs pages
# 1001 is your oinstall group, you can check this id with the grep oinstall /etc/group command
vm.hugetlb_shm_group = 1001
Replace kernel.shmmax with the half of your memory size in bytes
Max number of network connections. Use sysctl -a | grep ip_local_port_range to check.
net.ipv4.ip_local_port_range = 9000 65500
sysctl -a | grep ip_local_port_range
To allow dba to allocate hugetlbfs pages
125 is your oinstall group, you can check this id with the grep oinstall /etc/group command
vm.hugetlb_shm_group 的值是oinstall的组号
grep oinstall /etc/group
让配置生效
sysctl -p /etc/sysctl.conf
3.3、security limits
vi /etc/security/limits.d/local-oracle.conf
插入如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft memlock 204800
oracle hard memlock 204800
重启系统让配置生效
3.5、创建安装目录
mkdir -p /opt/oracle/product/11.2.0.1.0/dbhome
mkdir -p /opt/oraInventory
chown -R oracle:dba /opt/oracle/
chown -R oracle:dba /opt/oraInventory
3.6、依赖包安装
apt -y install alien autoconf automake autotools-dev binutils bzip2 doxygen elfutils expat gawk gcc gcc-multilib g++-multilib libelf-dev libltdl-dev libodbcinstq4-1 libodbcinstq4-1:i386 libpth-dev libpthread-stubs0-dev libstdc++5 make openssh-server rlwrap rpm sysstat unixodbc unixodbc-dev unzip x11-utils zlibc libaio1 libaio-dev
其中libodbcinstq4-1:i386的安装如下:
dpkg --add-architecture i386
apt update
apt install libodbcinstq4-1:i386
There are a few packages left to install, but to install them you’ll need these tips and tricks.
apt-get install ia32-libs
When you run the command to install this package with apt-get, you will see a message saying that this package is not available.
There is an alternative package that can be installed instead of ia32-libs. Install the lib32z1 alternative package:
apt-get install lib32z1
Let’s install the next package:
apt-get install libmotif4
This package is also not available. You should download and install this package manually. Download the libmotif4_2.3.4-8ubuntu1_amd64.deb file from a free resource. Save the downloaded deb file to a custom directory, for example, /home/user1/Downloads, before you can install this package.
The workflow of installing deb packages in Ubuntu is the following (execute commands with root privileges):
sudo dpkg -i package_name.deb
sudo apt-get -f install
In this case, we run the commands for installing packages as a regular user, for example, user1 by using sudo. Press Ctrl+D to exit the root session and to turn back to the user1 session in the console (terminal).
Go to the directory where the downloaded files are stored:
cd /home/user1/Downloads
Download the file by using a direct link:
wget http://launchpadlibrarian.net/207968936/libmotif4_2.3.4-8ubuntu1_amd64.deb
sudo dpkg -i libmotif4_2.3.4-8ubuntu1_amd64.deb
sudo apt-get -f install
The next package cannot be installed automatically:
sudo apt-get install libpthread-stubs0
E: Unable to locate package libpthread-stubs0
Download and install this package manually.
wget http://launchpadlibrarian.net/154418307/libpthread-stubs0-dev_0.3-4_amd64.deb
sudo dpkg -i libpthread-stubs0-dev_0.3-4_amd64.deb
sudo apt-get -f install
Similarly install the next package:
sudo apt-get install lsb-cxx
E: Unable to locate package lsb-cxx
You can download the lsb-cxx package manually.
wget http://packages.linuxmint.com//pool/upstream/l/lsb/lsb-cxx_4.1+Debian11ubuntu6mint1_amd64.deb
sudo dpkg -i lsb-cxx_4.1+Debian11ubuntu6mint1_amd64.deb
sudo apt-get -f install
Install one more package:
sudo apt-get install pdksh
E: Package ‘pdksh’ has no installation candidate
The workflow for installing the pdksh package is the same. This package can be downloaded here.
wget http://launchpadlibrarian.net/200019501/pdksh_50e-2ubuntu1_all.deb
sudo dpkg -i pdksh_50e-2ubuntu1_all.deb
sudo apt-get -f install
Oracle 11g requires the installation of the 32-bit version of the libstdc++5 package that is not installed on Ubuntu 16 automatically. Here’s how you can install this package manually.
The next commands are executed as root. Create a temporary directory to download the package:
mkdir /tmp/libstdc++5
cd /tmp/libstdc++5
Download the package (links to the 32-bit and 64-bit packages are shown):
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-30_i386.deb
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-30_amd64.deb
Install the downloaded packages with dpkg:
dpkg –force-architecture -i libstdc++5_3.3.6-30_i386.deb
Note: If links don’t work, newer versions of packages can be published instead of older versions. In this case, visit a web page in the browser and copy the correct links to the needed deb packages:
http://mirrors.edge.kernel.org/ubuntu/pool/universe/g/gcc-3.3/
Reboot the Linux machine to apply the changes.
init 6
3.7、解压安装包
su - oracle
unzip V17530-01_1of2.zip
unzip V17530-01_2of2.zip
3.9、主机名设置
假设主机名是XXX
/etc/hosts 必须包含主机名
示例如下
127.0.0.1 localhost
127.0.1.1 XXX
3.10、检查swap分区
swap大小是内存2倍
扩展swap分区
下面命令swap_1是swap分区名称
lvextend -L +5G /dev/debian-vg/swap_1
swapoff /dev/debian-vg/swap_1
mkswap /dev/debian-vg/swap_1
swapon /dev/debian-vg/swap_1
查看swap大小
3.11、PAM configuration
Ensure that the /etc/pam.d/login configuration file contains the following line:
session required pam_limits.so
You can do it with the command:
cat /etc/pam.d/login | grep pam_limits.so
If the mentioned line is missing, add this line manually.
3.12、Setting the shell profile
编辑 /etc/profile
vi /etc/profile
添加以下
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
使生效
source /etc/profile
3.12、创建符号链接
切换到root 用户
su - root
# mkdir /usr/lib64
ln -s /etc /etc/rc.d
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/basename /bin/basename
ln -s /usr/bin/rpm /bin/rpm
ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /usr/lib64/
ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/
ln -s /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib64/
ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
ln -sf /bin/bash /bin/sh
ln -s /etc/rc0.d /etc/rc.d/rc0.d
ln -s /etc/rc2.d /etc/rc.d/rc2.d
ln -s /etc/rc3.d /etc/rc.d/rc3.d
ln -s /etc/rc4.d /etc/rc.d/rc4.d
ln -s /etc/rc5.d /etc/rc.d/rc5.d
ln -s /etc/rc6.d /etc/rc.d/rc6.d
ln -s /etc/init.d /etc/rc.d/init.d
cd /lib64
ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 .
echo 'Red Hat Linux release 5' > /etc/redhat-release
3.13、oracle用户环境变量
su - oracle
vim ~/.bashrc
插入以下内容
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Enter your hostname
ORACLE_HOSTNAME=debian; export ORACLE_HOSTNAME
ORACLE_UNQNAME=ORADB11G; export ORACLE_UNQNAME
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.1.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=ORADB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
umask 022
使生效
source ~/.bashrc
4、安装
4.1、直接使用oracle用户进行ssh登录
shsell中把ssh连接属性配置成 enable X11Forwarding
vi /etc/ssh/sshd_config
确定有下面这行
4.2、执行安装程序
4.2.1、runInstaller
cd /path/to/oracle/database/
./runInstaller
报错无法
这是因为我是用的xshell软件不支持x图形界面调用
直接在服务器上执行安装程序则可以打开图形界面
如果只能使用终端工具如xshell进行安装,需要对终端软件做改造,使其能调用x图形界面
xdpyinfo | grep local
安装xmanager后,在xmanager里面新建xshell会话,这个会话会显示在xshell软件的会话管理器中,在xshell中打开这个会话可以调出X图形界面。再次执行安装程序
安装程序会通过xmanager软件调出X图形界面
检测也是通过的:tmp容量、交换区容量、能否调出X界面。
下面开始安装
第一步 跳过
4.2.2、选择安装类型
安装oracle并创建一个数据库
4.2.3、选择服务器安装还是桌面安装
选择服务器安装
4.2.4、选择单实例数据库安装 或者 Real Application Clusters数据库安装
单实例数据库安装
那么一个数据库只能对应一个实例;用户访问时这个数据库时,所有用户都是访问的同一个实例。
Real Application Clusters数据库安装
一个数据库可以对应多个实例;用户访问这个数据库时,可以通过多个实例让访问。
报错 服务器不是集群的一个
选择单实例数据库安装
4.2.5、选择自定义安装类型
4.2.6、选择语言
4.2.7、选择Enterprise Edition
4.2.8、选择安装目录和数据库目录
自动选择环境变量中设置的目录
4.2.9、选择inventory目录
自动选择环境变量中设置的目录
4.2.10、选择数据库用途
默认即可
4.2.11、数据库名和实例名
自动选择环境变量中设置的名称
4.2.12、内存、字符集、secure、samples
内存 50%
字符集 UTF-8
secure 选择所有
不启用samples 创建库后可以手动插入
内存不足会报错
4.2.13、选择database control for database management
4.2.14、Database Storage 默认选择FileSystem
4.2.15、自动备份
选择FileSystem
4.2.16、设置数据库用户密码
所有用户密码一致
4.2.17、选择OperatingSystemGroup
4.2.18、先决依赖项检查
勾选ignore all
4.2.19、安装概览
4.2.20、等待安装完成
查看安装日志
/opt/oraInventory/logs/installActions2023-04-24_04-11-48AM.log
报错
查看日志
cannot find /usr/lib64/libpthread_nonshared.a inside /
解决
http://pchero21.com/?p=2748
在/usr/lib/i386-linux-gnu/ 目录下 没有 libpthread_nonshared.a
解决方法:安装 libpthread_nonshared.a
这个库文件在libc6-dev中,libc6-dev的版本需要libc版本是在glibc/2.33-0experimental3 这个版本以上
参考链接 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971273
debian 10稳定版 glibc版本是2.31,因此需要使用sid源去安装glibc 2.33版本以上的版本。
编辑源文件
vi /etc/apt/sources.list
末尾添加一行
deb http://ftp.cn.debian.org/debian/ sid main contrib non-free
更新源
apt update
从sid源安装glibc 2.33版本以上的版本。
查看源中的软件包版本
apt-cache madison libc6
apt-cache madison libc6-dev
安装libc包
apt -t sid install libc6 libc6-dev
查找库文件libpthread_nonshared.a
find / -name libpthread_nonshared.a
升级提示
至此此问题解决,再次尝试安装oracle
升级了glibc后,安装依赖包后 开机 X界面调不出来了 ,只能全部用sid源更新系统,直接到debian 12。
报错
Error in invoking target ‘links proc gen_pcscfg’ of makefile ‘/opt/oracle/product/11.2.0.1.0/dbhome_1/precomp/lib/ins_precomp.mk’. See ‘/opt/oraInventory/logs/installActions2023-04-26_08-49-07AM.log’ for details.
解决方法
mkdir /opt/oracle/product/11.2.0.1.0/dbhome_1/precomp/lib/proc
然后点Retry
又发现了一个报错
报错
Error in invoking target ‘install’ of makefile ‘/opt/oracle/product/11.2.0.1.0/dbhome_1/ctx/lib/ins_ctx.mk’. See ‘/opt/oraInventory/logs/installActions2023-04-26_08-49-07AM.log’ for details.
INFO: /usr/bin/ld: /opt/oracle/product/11.2.0.1.0/dbhome_1/lib//libpsa11.a(plsw.o): relocation R_X86_64_32 against `_2__STRING.12.0’ can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
INFO: collect2: error: ld returned 1 exit status
INFO: make: *** [/opt/oracle/product/11.2.0.1.0/dbhome_1/plsql/lib/ins_plsql.mk:35: wrap] Error 1
INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target ‘install’ of makefile ‘/opt/oracle/product/11.2.0.1.0/dbhome_1/plsql/lib/ins_plsql.mk’. See ‘/opt/oraInventory/logs/installActions2023-04-26_08-49-07AM.log’ for details.
报错
报错
运行脚本
On the screenshot below you can see that the scripts have been executed successfully.
The installation of Oracle Database was successful.
If you see this notification, you can close the Oracle installer window.
Check that Oracle is running on Debian
更多推荐
所有评论(0)