CentOS下使用rpm安装Oracle19C
下载 下载database 到oracle官网下载地址 下载最新的oracle,选择Linux x86-64
中的RPM,点击下载(需登录),浏览器跳出下载后暂定下载,复制下载链接。
在服务器上下载
1 wget https://download.oracle.com/otn/linux/oracle19 c/190000 /oracle-database-ee-19 c-1 .0 -1 .x86 _64 .rpm?AuthParam=xxxx
上面的AuthParam
需要更换为自己的
下载preinstall 到下载地址 搜索preinstall
,下载最新版
1 wget https://yum.oracle.com/repo/OracleLinux/OL7 /latest/x86 _64 /getPackage/oracle-database-preinstall-19 c-1 .0 -3 .el7 .x86 _64 .rpm
安装 关闭防火墙和SELINUX 1 sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config & setenforce 0&& systemctl disable firewalld.service && systemctl stop firewalld.service
1 2 3 4 5 6 7 [root@localhost src]# cat /etc/security/limits.d/20 -nproc.conf # Default limit for number of user's processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. * soft nproc 4096 root soft nproc unlimited
安装preinstall 1 yum localinstall -y oracle-database-preinstall-19 c-1 .0 -3 .el7 .x86 _64 .rpm
安装database 1 yum localinstall -y oracle-database-ee-19 c-1 .0 -1 .x86 _64 .rpm
查看实例端口和路径 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@localhost src] LISTENER_PORT =1521 ORACLE_DATA_LOCATION =/opt/oracle/oradataEM_EXPRESS_PORT =5500
配置 创建数据库实例 1 /etc/i nit.d/oracledb_ORCLCDB-19 c configure
过程很慢,静心等待
配置环境变量 1 vim /home/oracle/.bash_profile
添加如下内容:
1 2 3 4 5 6 export ORACLE_BASE=/opt/oracle export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 export ORACLE_SID=ORCLCDB export PATH=$ORACLE_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib export NLS_LANG=AMERICAN_AMERICA.UTF8
使修改立即生效:
1 source /home/ oracle/.bash_profile
修改oracle密码
登录数据库 1 2 su - oraclesqlplus / as sysdba
sys默认密码:change_on_install
使用SQL Plus登录数据库时,system使用密码manager
可直接登录。 但如果是sys用户,密码必须加上as sysdba,即完整密码为:change_on_install as sysdba
默认服务名:ORCLCDB
修改密码
监听 1 2 3 lsnrctl status lsnrctl stop lsnrctl start
使用 创建用户 创建用户名为devops和密码为devops123的用户;
1 grant create user ,drop user ,alter user ,create any view ,connect ,resource,dba,create session ,create any sequence to devops123;
修改密码:
1 alter user devops identified by 123456 ;
授权 1 grant create user ,drop user ,alter user ,create any view ,connect ,resource,dba,create session ,create any sequence to c#devops ;