Total size: 6.9 G Installed size: 6.9 G Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : oracle-database-ee-19c-1.0-1.x86_64 1/1 [INFO] Executing post installation scripts... [INFO] Oracle home installed successfully and ready to be configured. To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure Verifying : oracle-database-ee-19c-1.0-1.x86_64 1/1
/etc/init.d/oracledb_ORCLCDB-19c configure # 时间较长 耐心等待。。。 ...... # 安装完成 100% complete Database creation complete. For details check the logfiles at: /opt/oracle/cfgtoollogs/dbca/ORCLCDB. Database Information: Global Database Name:ORCLCDB System Identifier(SID):ORCLCDB Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user. [root@iZwz9cn4n7x5qttry9g2ggZ ~]#
修改 oracle 用户密码
1 2 3 4 5 6 7 8
[root@iZwz9cn4n7x5qttry9g2ggZ ~]# passwd oracle Changing password for user oracle. New password: (1qaz!QAZ) BAD PASSWORD: The password fails the dictionary check - it is based on a (reversed) dictionary word Retype new password: (1qaz!QAZ) passwd: all authentication tokens updated successfully. [root@iZwz9cn4n7x5qttry9g2ggZ ~]#
[root@iZwz9cn4n7x5qttry9g2ggZ ~]# su - oracle Last login: Mon May 3 16:53:04 CST 2021 on pts/0 [oracle@iZwz9cn4n7x5qttry9g2ggZ ~]$ sqlplus / as sysdba -bash: sqlplus: command not found [oracle@iZwz9cn4n7x5qttry9g2ggZ ~]$ #通过百度 解决办法。新建文件 添加如下内容并保存
[root@iZwz9cn4n7x5qttry9g2ggZ ~]# vim /etc/profile.d/oracle19c.sh export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin export ORACLE_SID=ORCLCDB # 使文件生效 source /etc/profile # 检查是否生效 [root@iZwz9cn4n7x5qttry9g2ggZ ~]# echo $ORACLE_SID ORCLCDB ###################### #再次登录 [root@iZwz9cn4n7x5qttry9g2ggZ ~]# su - oracle Last login: Mon May 3 16:53:57 CST 2021 on pts/0 [oracle@iZwz9cn4n7x5qttry9g2ggZ root]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 3 18:58:14 2021 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance. #启动实例 SQL> startup; ORACLE instance started.
Total System Global Area 738194408 bytes Fixed Size 9139176 bytes Variable Size 478150656 bytes Database Buffers 247463936 bytes Redo Buffers 3440640 bytes Database mounted. Database opened. SQL> #修改密码 SQL> password system Changing password for system New password: Retype new password: Password changed #登录 SQL> conn system/123456 Connected. SQL> show user USER is "SYSTEM" SQL> ### 另开窗口:进入 ${ORACLE_HOME}/bin 下 ### su oracle ### 执行: [oracle@iZwz9cn4n7x5qttry9g2ggZ bin]$ lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 03-MAY-2021 19:17:13
Copyright (c) 1991, 2019, Oracle. All rights reserved.
TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/iZwz9cn4n7x5qttry9g2ggZ/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=iZwz9cn4n7x5qttry9g2ggZ)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=iZwz9cn4n7x5qttry9g2ggZ)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 03-MAY-2021 19:17:15 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/iZwz9cn4n7x5qttry9g2ggZ/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=iZwz9cn4n7x5qttry9g2ggZ)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services The command completed successfully [oracle@iZwz9cn4n7x5qttry9g2ggZ bin]$
修改数据库登录密码
查看已启用的用户
1 2 3 4 5 6
SQL> select username from dba_users where account_status='OPEN';
USERNAME -------------------------------------------------------------------------------- SYS SYSTEM
修改密码
1 2 3 4 5 6 7 8 9 10
#修改密码 SQL> password system Changing password for system New password: Retype new password: Password changed #或者 alter user sys identified by [密码] alter user SYSTEM identified by [密码]
解锁用户
1 2
#若用新建用户登录时遇到ORA-01017则需要对用户进行解锁操作 ALTER USER username ACCOUNT UNLOCK;
sqlplus / as sysdba shutdown abort # startup mount SQL> startup; ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/opt/oracle/product/19c/dbhome_1/dbs/initORCLCDB.ora'