📢📢📢📣📣📣
哈喽!大家好,我是【IT邦德】,江湖人称jeames007,10年DBA工作经验
一位上进心十足的【大数据领域博主】!😜😜😜
中国DBA联盟(ACDU)成员,目前从事DBA及程序编程
擅长主流数据Oracle、MySQL、PG 运维开发,备份恢复,安装迁移,性能优化、故障应急处理等。
✨ 如果有对【数据库】感兴趣的【小可爱】,欢迎关注【IT邦德】💞💞💞
❤️❤️❤️感谢各位大可爱小可爱!❤️❤️❤️
前言
最近一直在研究OGG的部署,需要在Linux环境下安装Oralce 19C的客户端,总结分享给各位粉丝们📣 1.官方网站下载相应软件
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
选择Linux下客户端工具,注意选择基础软件包和PL/SQL工具包
instantclient-basic-linux.x64-19.16.0.0.0dbru.zip
instantclient-sqlplus-linux.x64-19.16.0.0.0dbru.zip
📣 2.上传到客户端服务器并解压
说明:
1、使用oracle用户解压,解压到安装路径(此处为oracle用户根目录)
2、解压完毕后会多出一个目录:instantclient_19_16,所有的软件都在里面
[root@ogg21c ~]# mv instantclient* /home/oracle
[root@ogg21c ~]# chown oracle:oinstall /home/oracle/instantclient*
[root@ogg21c ~]# chmod +x /home/oracle/instantclient*
[root@ogg21c ~]# su - oracle
Last login: Mon Oct 10 15:23:29 CST 2022 on pts/0
[oracle@ogg21c ~]$ ll
total 74020
-rwxr-xr-x 1 oracle oinstall 74882203 Oct 10 07:19 instantclient-basic-linux.x64-19.16.0.0.0dbru.zip
-rwxr-xr-x 1 oracle oinstall 911669 Oct 10 07:18 instantclient-sqlplus-linux.x64-19.16.0.0.0dbru.zip
[oracle@ogg21c ~]$ unzip instantclient-basic-linux.x64-19.16.0.0.0dbru.zip
[oracle@ogg21c ~]$ unzip instantclient-sqlplus-linux.x64-19.16.0.0.0dbru.zip
[oracle@ogg21c ~]$ ll
total 74024
drwxr-xr-x 3 oracle oinstall 4096 Oct 10 15:25 instantclient_19_16
-rwxr-xr-x 1 oracle oinstall 74882203 Oct 10 07:19 instantclient-basic-linux.x64-19.16.0.0.0dbru.zip
-rwxr-xr-x 1 oracle oinstall 911669 Oct 10 07:18 instantclient-sqlplus-linux.x64-19.16.0.0.0dbru.zip
📣 3.配置环境变量
cat >> .bash_profile << "EOF"
export ORACLE_HOME=/home/oracle/instantclient_19_16/
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$ORACLE_HOME:$PATH
EOF
[oracle@ogg21c ~]$ source .bash_profile
📣 4.配置tnsnames.ora文件
[oracle@ogg21c ~]$ cd /home/oracle/instantclient_19_16/network/admin
创建tnsnames.ora文件
[oracle@ogg21c admin]$ vi tnsnames.ora
ORA11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.48)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MES)
)
)
📣 5. 测试连接
[oracle@ogg21c ~]$ sqlplus scott/tiger@ORA11G
[oracle@ogg21c ~]$ sqlplus scott/tiger@192.168.1.48:1521/mes