docker run --privileged --name oracle11g -p 1521:1521 -v /home:/install -d jaspeen/oracle-11g
参考:
https://www.35youth.cn/685.html
二、创建oracle用户
打开命令提示框输入以下内容
1.输入:sqlplus /nolog //进入oralce控制台
2.输入:conn /as sysdba //以管理员权限登录
3.输入:create user abc identified by 123456; //创建用户名adc密码123456
4.输入:grant dba to abc; //授予DBA权限
或---------------以下实测有效-20201104-------------------------------
1、进入oracle容器内
2、输入:su - oracle
3、输入:sqlplus / as sysdba
4、输入:create user abc identified by 123456; //创建用户名adc密码123456
5.输入:grant dba to abc; //授予DBA权限
https://www.cnblogs.com/sugarwxx/p/12696852.html
四、创建表空间
create tablespace yg_data
datafile 'D:\oracledata\yu.dbf'
size 50m
autoextend on /*autoextend on 表空间大小不够用时自动扩展*/
next 50m ;
建好tablespace,就可以建用户了,并指定用户默认的表空间
格式:create user 用户名 identified by 密码 default tablespace 表空间名;
例子:create user test identified by test123 default tablespace sp001;
1、查看表空间的名称及大小
SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size
FROM dba_tablespaces t, dba_data_files d
WHERE t.tablespace_name = d.tablespace_name
GROUP BY t.tablespace_name;
--2、查看表空间物理文件的名称及大小
SELECT tablespace_name,
file_id,
file_name,
round(bytes / (1024 * 1024), 0) total_space
FROM dba_data_files
ORDER BY tablespace_name;