技术博客
Oracle一键安装
本章目标:掌握本章核心知识点 前置要求:完成前序章节学习 预计时长:60 分钟
Oracle 一键安装脚本,演示华为 Ubuntu 14.04 一键安装 Oracle 19C 单机版过程(全程无需人工干预)。
⭐️ 脚本下载地址:Shell脚本安装Oracle数据库
# 主机版本root@Ubuntu14:~# cat /etc/os-release NAME="Ubuntu"VERSION="14.04.6 LTS, Trusty Tahr"ID=ubuntuID_LIKE=debianPRETTY_NAME="Ubuntu 14.04.6 LTS"VERSION_ID="14.04"HOME_URL="http://www.ubuntu.com/"SUPPORT_URL="http://help.ubuntu.com/"BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"# 网络信息root@Ubuntu14:~# ip a2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:0c:29:7b:de:0b brd ff:ff:ff:ff:ff:ff inet 192.168.6.73/24 brd 192.168.6.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe7b:de0b/64 scope link valid_lft forever preferred_lft forever# 连接外网测试root@Ubuntu14:~# ping www.baidu.comPING www.a.shifen.com (180.101.50.242) 56(84) bytes of data.64 bytes from www.baidu.com (180.101.50.242): icmp_seq=1 ttl=53 time=4.95 ms64 bytes from www.baidu.com (180.101.50.242): icmp_seq=2 ttl=53 time=5.14 ms64 bytes from www.baidu.com (180.101.50.242): icmp_seq=3 ttl=53 time=5.62 ms64 bytes from www.baidu.com (180.101.50.242): icmp_seq=4 ttl=53 time=5.60 ms64 bytes from www.baidu.com (180.101.50.242): icmp_seq=5 ttl=53 time=5.65 ms# 安装包存放在 /soft 目录下root@Ubuntu14:/soft# ls -l-rwx------ 1 root root 3059705302 6月 6 11:40 LINUX.X64_193000_db_home.zip-rwxr-xr-x 1 root root 218544 6月 6 11:41 OracleShellInstall默认使用专业版脚本。脚本下载:ora100.com/shell-install 确保安装环境准备完成后,即可执行一键安装。
使用标准生产环境安装参数(安装过程若失败,脚本支持重复执行安装):
# 根据脚本 README 或者 -h 命令提示,编辑好一键安装命令,进入 /soft 目录执行安装:./OracleShellInstall -lf eth0 `# local ip ifname`\-n Ubuntu14 `# hostname`\-op oracle `# oracle password`\-d /u01 `# software base dir`\-ord /oradata `# data dir`\-o lucifer `# dbname`\-dp oracle `# sys/system password`\-ds AL32UTF8 `# database character`\-ns AL16UTF16 `# national character`\-redo 100 `# redo size`\-opd Y `# optimize db`默认使用专业版脚本。脚本下载:ora100.com/shell-install
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██ ██░░░░░██ ░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██ ██ ░░██ ██████ ██████ █████ ░██ █████ ░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██░██ ░██░░██░░█ ░░░░░░██ ██░░░██ ░██ ██░░░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██░██ ░██ ░██ ░ ███████ ░██ ░░ ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██░░██ ██ ░██ ██░░░░██ ░██ ██ ░██░██░░░░ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██ ░░███████ ░███ ░░████████░░█████ ███░░██████ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███ ░░░░░░░ ░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░注意:本脚本仅用于新服务器上实施部署数据库使用,严禁在已运行数据库的主机上执行,以免发生数据丢失或者损坏,造成不可挽回的损失!!!请选择安装模式 [单机(si)/单机ASM(sa)/集群(rac)] : si数据库安装模式: single请选择数据库版本 [11/12/19/21] : 19数据库版本: 19!!! 免责声明:当前操作系统版本是 [ Ubuntu 14.04.6 LTS ] 不在 Oracle 官方支持列表,本脚本只负责安装,请确认是否继续安装 (Y/N): [Y]OracleShellInstall 开始安装,详细安装过程可查看日志: tail -2000f /soft/print_shell_install_.log 正在去除密码复杂度配置......已完成 (耗时: 0 秒)正在配置网络软件源......已完成 (耗时: 13 秒)正在获取操作系统信息......已完成 (耗时: 1 秒)正在安装依赖包......已完成 (耗时: 45 秒)正在配置 Swap......已完成 (耗时: 0 秒)正在配置防火墙......已完成 (耗时: 0 秒)正在配置 selinux......已完成 (耗时: 0 秒)正在配置主机名和 /etc/hosts......已完成 (耗时: 0 秒)正在创建用户和组......已完成 (耗时: 1 秒)正在创建安装目录......已完成 (耗时: 2 秒)正在配置透明大页 && NUMA && 磁盘 IO 调度器......已完成 (耗时: 3 秒)正在配置操作系统参数 sysctl......已完成 (耗时: 1 秒)正在配置用户限制 limit......已完成 (耗时: 1 秒)正在配置 shm 目录......已完成 (耗时: 1 秒)正在配置用户环境变量......已完成 (耗时: 1 秒)正在解压 Oracle 安装包以及补丁......已完成 (耗时: 130 秒)正在安装 Oracle 软件以及补丁......已完成 (耗时: 129 秒)正在创建监听......已完成 (耗时: 14 秒)正在创建数据库......已完成 (耗时: 646 秒)正在优化数据库......已完成 (耗时: 22 秒)恭喜!Oracle 单机安装成功 (耗时: 1011 秒),现在是否重启主机:[Y/N] Y正在重启当前节点主机......默认使用专业版脚本。脚本下载:ora100.com/shell-install
查看系统版本:
[root@Ubuntu14:/root]# cat /etc/os-release NAME="Ubuntu"VERSION="14.04.6 LTS, Trusty Tahr"ID=ubuntuID_LIKE=debianPRETTY_NAME="Ubuntu 14.04.6 LTS"VERSION_ID="14.04"HOME_URL="http://www.ubuntu.com/"SUPPORT_URL="http://help.ubuntu.com/"BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"查看 Oracle 版本以及补丁:
[oracle@Ubuntu14:/home/oracle]$ sqlplus -vSQL*Plus: Release 19.0.0.0.0 - ProductionVersion 19.3.0.0.0[oracle@Ubuntu14:/home/oracle]$ opatch lspatches29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)29517242;Database Release Update : 19.3.0.0.190416 (29517242)OPatch succeeded.查看监听:
[oracle@Ubuntu14:/home/oracle]$ lsnrctl statLSNRCTL for Linux: Version 19.0.0.0.0 - Production on 07-JUN-2024 00:10:53Copyright (c) 1991, 2019, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Ubuntu14)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 19.0.0.0.0 - ProductionStart Date 06-JUN-2024 12:37:37Uptime 0 days 11 hr. 33 min. 15 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/19.3.0/db/network/admin/listener.oraListener Log File /u01/app/oracle/diag/tnslsnr/Ubuntu14/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Ubuntu14)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Services Summary...Service "lucifer" has 1 instance(s). Instance "lucifer", status READY, has 1 handler(s) for this service...Service "luciferXDB" has 1 instance(s). Instance "lucifer", status READY, has 1 handler(s) for this service...The command completed successfully连接数据库:
[oracle@Ubuntu14:/home/oracle]$ sasSQL*Plus: Release 19.0.0.0.0 - Production on Fri Jun 7 00:10:54 2024Version 19.3.0.0.0Copyright (c) 1982, 2019, Oracle. All rights reserved.Connected to:Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - ProductionVersion 19.3.0.0.0sys@LUCIFER 2024-06-07 00:10:55> show parameter nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------cdb_cluster_name stringcell_offloadgroup_name stringdb_file_name_convert stringdb_name string luciferdb_unique_name string luciferglobal_names boolean FALSEinstance_name string luciferlock_name_space stringlog_file_name_convert stringpdb_file_name_convert stringprocessor_group_name stringservice_names string lucifer数据库连接正常。