Centos7版本测试安装通过,其他版本未测
oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm oracle-database-ee-19c-1.0-1.x86_64.rpm
输入命令:
rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
用 yum install -y 依赖名安装 (多个依赖用空格隔开):(每一行的后面不要使用回车,命令输在一行,让它自动换行)
yum install -y bc bind-utils compat-libcap1 compat-libstdc++-33 glibc-devel ksh libaio-devel libstdc++-devel net-tools nfs-utils psmisc smartmontools sysstat unzip xorg-x11-utils xorg-x11-xauth
rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
/etc/init.d/oracledb_ORCLCDB-19c configure
如果安装Centos时设置的是30G,一般不会出现这个问题,如果是20G,可能会空间不足。
[root@localhost ]# vi /etc/profile
以下是增加内容,可以加到已有的export后面
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
[root@localhost ]# vi /home/oracle/.bash_profile
以下是增加内容,可以加到已有的export后面
export PATH 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 #LANG=C LANG=zh_CN.UTF-8; export LANG NLS_LANG="SIMPLIFIED CHINESE_CHINA.al32utf8"; export NLS_LANG
source /etc/profile source /home/oracle/.bash_profile
systemctl status firewalld systemctl stop firewalld systemctl disable firewalld
[root@localhost ]# su oracle
[oracle@localhost ]$ chmod 6751 $ORACLE_HOME/bin/oracle
[oracle@localhost etc]$ lsnrctl status
未启动需要启动
[oracle@localhost etc]$ lsnrctl start
[oracle@localhost ]$ sqlplus /nolog
进入sqlplus环境,nolog参数表示不登录:
sqlplus /nolog
查看数据库的pdb:
select con_id,name,open_mode from v$pdbs;
默认 用户/密码连接,返回Connected:
SQL> conn /as sysdba
SQL> select global_name from global_name;
SQL> password system;
更改 system 的口令
新口令:system
重新键入新口令:system
口令已更改
端口:1521
服务名:ORCLCDB
用户名:system
密码:system
[root@localhost ]# su oracle
sqlplus /nolog SQL> conn as sysdba
Enter user-name: system(用户名)
Enter password: (密码)
Connected to an idle instance.
启动数据库:
SQL> startup
关闭数据库:
SQL> shutdown
修改sys 用户的密码:
ALTER USER SYS IDENTIFIED BY "sys";