部门开发和测试的两台web环境在刀片机上运行了将近11年,之前使用配p2v迁移软件迁移到vmvare的虚拟机上中途报错,报错内容为 an error occurred during the conversion: ‘keeponebootentry: there is matching kernel modules for kernel /boot/xen,gz-2.6.18-8.el5’,查资料为vmvare虚拟环境不支持xen的内核。没有办法只能重新搭建环境,顺便装版本高一点的操作系统和软件。
gztvtest/root>fdisk -l
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 637 5116671 83 Linux
/dev/cciss/c0d0p2 638 1912 10241437+ 83 Linux
/dev/cciss/c0d0p3 1913 2549 5116702+ 83 Linux
/dev/cciss/c0d0p4 2550 17844 122857087+ 5 Extended
/dev/cciss/c0d0p5 2550 3059 4096543+ 82 Linux swap / Solaris
/dev/cciss/c0d0p6 3060 15804 102374181 8e Linux LVM
/dev/cciss/c0d0p7 15805 16314 4096543+ 83 Linux
/dev/cciss/c0d0p8 16315 16824 4096543+ 83 Linux
/dev/cciss/c0d0p9 16825 17334 4096543+ 83 Linux
/dev/cciss/c0d0p10 17335 17844 4096543+ 83 Linux
gztvtest/root> tune2fs -l /dev/cciss/c0d0p1 | grep create
Filesystem created: Thu Jul 24 02:29:56 2008
系统是2008年7月安装的,到现在为止已经11年。果然很老了,机房刀片机能跑这么久也是佩服(散热,噪音,耗电也是这种老机器的特点)
[root@web1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.16.19.2 web1
[root@web1 ~]# useradd oracle
[root@web1 ~]# passwd oracle
Changing password for user oracle.
New password: oracle
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password: oracle
passwd: all authentication tokens updated successfully.
这里创建用户可以按照特定要求创建,比如UID,相关组等。
sftp> lcd d:/
sftp> cd /oracle/
sftp> put instantclient-basic-linux.x64-12.2.0.1.0.zip
sftp> put instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
sftp> put instantclient-basiclite-linux.x64-12.2.0.1.0.zip
sftp> put instantclient-jdbc-linux.x64-12.2.0.1.0.zip
sftp> put instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
sftp> put instantclient-tools-linux.x64-12.2.0.1.0.zip
[root@web1 ~]# chown oracle:oracle -R /oracle/
[root@web1 ~]# su - oracle
[root@web1 ~]# cd /oracle
[root@web1 oracle]# unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
[root@web1 oracle]# unzip instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
[root@web1 oracle]# unzip instantclient-basiclite-linux.x64-12.2.0.1.0.zip
[root@web1 oracle]# unzip instantclient-jdbc-linux.x64-12.2.0.1.0.zip
[root@web1 oracle]# unzip instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
[root@web1 oracle]# unzip instantclient-tools-linux.x64-12.2.0.1.0.zip
注意:
这里需要先解压instantclient-basic-linux.x64-12.2.0.1.0.zip基础包
[oracle@web1 instantclient_12_2]$ pwd
/oracle/instantclient_12_2
[oracle@web1 instantclient_12_2]$ mkdir -p network/admin
[oracle@web1 ~]$ cd /oracle/instantclient_12_2/
[oracle@web1 instantclient_12_2]$ cd network/admin/
[oracle@web1 admin]$ vi tnsnames.ora
gdvassp =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.9.69)(PORT = 1521))
)
(CONNECT_DATA =
(SID = gdvassp)
(SERVER = DEDICATED)
)
)
[oracle@web1 ~]$ cd
[oracle@web1 ~]$ pwd
/home/oracle
[oracle@web1 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/instantclient_12_2
export LD_LIBRARY_PATH=$ORACLE_HOM/lib
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=american_america.zhs16gbk
export PATH=$ORACLE_HOME:$PATH:
[oracle@web1 ~]$ source .bash_profile
[oracle@web1 ~]$ sqlplus scott/scott@gdvassp
SQL*Plus: Release 12.2.0.1.0 Production on Wed Aug 21 16:25:53 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
到这里能正常连接测试开发数据库,表示客户端安装成功了。
如果想安装下一台可以把这个安装路径打成一个压缩包,然后上传到其他机器解压配置下环境变量后也可以直接用这个客户端。
[root@web1 oracle]# tar -zcvf instantclient_12_2.tar.gz instantclient_12_2
instantclient_12_2/
instantclient_12_2/sqlplus
instantclient_12_2/genezi
instantclient_12_2/SQLPLUS_README
instantclient_12_2/libclntsh.so.12.1
instantclient_12_2/libnnz12.so
instantclient_12_2/network/
instantclient_12_2/network/admin/
instantclient_12_2/network/admin/tnsnames.ora
instantclient_12_2/ODBC_IC_Readme_Unix.html
instantclient_12_2/orai18n-mapping.jar
instantclient_12_2/libocijdbc12.so
instantclient_12_2/glogin.sql
instantclient_12_2/libheteroxa12.so
instantclient_12_2/libocci.so.12.1
instantclient_12_2/impdp
instantclient_12_2/libipc1.so
instantclient_12_2/liboramysql12.so
instantclient_12_2/libsqora.so.12.1
instantclient_12_2/BASIC_LITE_README
instantclient_12_2/libociei.so
instantclient_12_2/exp
instantclient_12_2/TOOLS_README
instantclient_12_2/libmql1.so
instantclient_12_2/adrci
instantclient_12_2/libsqlplus.so
instantclient_12_2/imp
instantclient_12_2/JDBC_README
instantclient_12_2/help/
instantclient_12_2/help/us/
instantclient_12_2/help/us/toc.htm
instantclient_12_2/help/us/img/
instantclient_12_2/help/us/img/odbcmodel.gif
instantclient_12_2/help/us/img/setup_work.gif
instantclient_12_2/help/us/img/odbcdrvarch.gif
instantclient_12_2/help/us/img/setup_ssmig.gif
instantclient_12_2/help/us/img/setup_app.gif
instantclient_12_2/help/us/img/setup_ora.gif
instantclient_12_2/help/us/sqora.htm
instantclient_12_2/help/us/blafdoc.css
instantclient_12_2/help/us/map.xml
instantclient_12_2/help/us/img_text/
instantclient_12_2/help/us/img_text/setup_work.htm
instantclient_12_2/help/us/img_text/setup_app.htm
instantclient_12_2/help/us/img_text/odbcdrvarch.htm
instantclient_12_2/help/us/img_text/setup_ssmig.htm
instantclient_12_2/help/us/img_text/odbcmodel.htm
instantclient_12_2/help/us/img_text/setup_ora.htm
instantclient_12_2/help/us/cpyr.htm
instantclient_12_2/help/us/oracle.gif
instantclient_12_2/help/us/META-INF/
instantclient_12_2/help/us/META-INF/MANIFEST.MF
instantclient_12_2/help/ja/
instantclient_12_2/help/ja/toc.htm
instantclient_12_2/help/ja/img/
instantclient_12_2/help/ja/img/odbcmodel.gif
instantclient_12_2/help/ja/img/setup_work.gif
instantclient_12_2/help/ja/img/odbcdrvarch.gif
instantclient_12_2/help/ja/img/setup_ssmig.gif
instantclient_12_2/help/ja/img/setup_app.gif
instantclient_12_2/help/ja/img/setup_ora.gif
instantclient_12_2/help/ja/sqora.htm
instantclient_12_2/help/ja/blafdoc.css
instantclient_12_2/help/ja/map.xml
instantclient_12_2/help/ja/img_text/
instantclient_12_2/help/ja/img_text/setup_work.htm
instantclient_12_2/help/ja/img_text/setup_app.htm
instantclient_12_2/help/ja/img_text/odbcdrvarch.htm
instantclient_12_2/help/ja/img_text/setup_ssmig.htm
instantclient_12_2/help/ja/img_text/odbcmodel.htm
instantclient_12_2/help/ja/img_text/setup_ora.htm
instantclient_12_2/help/ja/cpyr.htm
instantclient_12_2/help/ja/oracle.gif
instantclient_12_2/help/ja/META-INF/
instantclient_12_2/help/ja/META-INF/MANIFEST.MF
instantclient_12_2/libsqlplusic.so
instantclient_12_2/BASIC_README
instantclient_12_2/libons.so
instantclient_12_2/odbc_update_ini.sh
instantclient_12_2/expdp
instantclient_12_2/wrc
instantclient_12_2/xstreams.jar
instantclient_12_2/libclntshcore.so.12.1
instantclient_12_2/ojdbc8.jar
instantclient_12_2/uidrvci
instantclient_12_2/libnfsodm12.so
instantclient_12_2/orai18n.jar
instantclient_12_2/sqlldr
[root@web1 oracle]# ll
total 175812
drwxrwxr-x. 4 oracle oracle 4096 Aug 21 15:53 instantclient_12_2
-rw-r--r--. 1 root root 73191540 Aug 22 10:28 instantclient_12_2.tar.gz
上传到其他服务解压后配置下环境变量就可以直接用了