= RWA 系统
== colima docker
[source,bash]
----
nerd run -d --name oracle \
-p 1521:1521 \
-e ORACLE_PWD=Wspsc123 \
-e ORACLE_CHARACTERSET=ZHS16GBK \
-v /Users/wangshaoping/wspsc/software/docker/volume/oracle_v21.3.0-xe:/opt/mnt \
container-registry.oracle.com/database/express:21.3.0-xe
----
TIP: 数据库字符集需要 ZHS16GBK

== 创建数据对象
[source,bash]
----
# 进入容器操作系统
nerd exec -it oracle bash

# 进入 sqlplus
sqlplus / as sysdba

# 显示当前数据库
SQL>show con_name;

# 显示内容如下:
# CON_NAME
# ------------------------------
# CDB$ROOT

# 显示可插拔数据库
SQL>show pdbs;

# 显示内容如下:
CON_ID CON_NAME	      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED			  READ ONLY  NO
     3 XEPDB1			  READ WRITE NO

# 切换到可拔插的数据库 XEPDB1
SQL>alter session set container=XEPDB1;

# 查看字符集
SQL>select userenv('language') from dual;

# 查看 dmp 文件字符集
SQL>select nls_charset_name(to_number('0354','xxxx')) from dual;

# 修改字符集
SQL>ALTER DATABASE CHARACTER SET ZHS16GBK;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;

# 创建表空间
SQL>create tablespace "TBS_DATA" logging datafile '/opt/oracle/oradata/XE/XEPDB1/rwa_show.dbf' size 100m autoextend on next 100m extent management local;

# 创建用户
SQL>create user "RWA_SHOW" identified by "rwa_show" default tablespace "TBS_DATA" temporary tablespace "TEMP";

# 授权用户
SQL>grant dba,connect,resource to "RWA_SHOW";

# 删除相关对象
SQL>drop user "RWA_SHOW" cascade;
SQL>drop tablespace "TBS_DATA" including contents and datafiles;

# 显示 dba_directories 信息
SQL>set line 130;
col owner for a10;
col directory_name for a30;
col directory_path for a80;
select owner,directory_name,directory_path from dba_directories order by directory_name;

# 创建 directory
SQL>create or replace directory DATA_PUMP_DIR_MNT as '/opt/mnt';
----

== 导入数据
[source,bash]
----
impdp rwa_show/rwa_show@XEPDB1 schemas=rwa_show dumpfile=rwa_show20230407.dmp directory=DATA_PUMP_DIR_MNT logfile=rwa_show.log
----

[source,bash]
----
impdp '/ as sysdba' dumpfile=rwa_show20230407.dmp logfile=import_log.txt sqlfile=ddl_dump.txt
----

== 构建后端工程


== 用户名密码
|===
| 用户名       | 密码            | 说明
| admin       | 000000          | 系统管理员
|===
