su - oracle
dbca -silent -createDatabase -responseFile ${ORACLE_HOME}/assistants/dbca/dbca.rsp
数据库根据配置文件的选项,设置了默认密码和Net Service Name如下:
user:sys
passwd:Oracle123
Net Service Name:orcl
通过以下命令查看service和数据库状态:
[oracle@rac3 admin]$ srvctl status service -db orcl -verbose
Database orcl does not have services
[oracle@rac3 admin]$ srvctl status database -db orcl -verbose
Instance orcl1 is running on node rac3. Instance status: Open.
Instance orcl2 is running on node rac4. Instance status: Open.
通过以下语句查看数据库实例:
[oracle@rac3 admin]$ sqlplus sys/Oracle123@rac3/orcl as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Apr 28 17:15:36 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
orcl1
[oracle@rac3 admin]$ sqlplus sys/Oracle123@rac4/orcl as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Apr 28 17:15:57 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
orcl2
创建测试用户
通过以下语句查看当前用户:
[oracle@rac3 db_1]$ sqlplus sys/Oracle123@rac4/orcl as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 29 12:18:51 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select username from all_users;
USERNAME
--------------------------------------------------------------------------------
SYS
AUDSYS
SYSTEM
SYSBACKUP
SYSDG
SYSKM
SYSRAC
OUTLN
XS$NULL
GSMADMIN_INTERNAL
GSMUSER
USERNAME
--------------------------------------------------------------------------------
GSMROOTUSER
DIP
REMOTE_SCHEDULER_AGENT
DBSFWUSER
ORACLE_OCM
SYS$UMF
DBSNMP
APPQOSSYS
GSMCATUSER
GGSYS
XDB
USERNAME
--------------------------------------------------------------------------------
ANONYMOUS
WMSYS
MDDATA
OJVMSYS
CTXSYS
ORDSYS
ORDDATA
ORDPLUGINS
SI_INFORMTN_SCHEMA
MDSYS
OLAPSYS
USERNAME
--------------------------------------------------------------------------------
DVSYS
LBACSYS
DVF
通过以下语句创建用户,并授予权限,查看新创建的用户:
[oracle@rac3 db_1]$ sqlplus sys/Oracle123@rac4/orcl as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 29 12:18:51 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> create user swingbench identified by swingbench123;
SQL> grant connect,resourse,dba to swingbench;
SQL> select username from all_users;