安装
1 | docker pull loliconneko/oracle-ee-11g |
启动
docker run 命令
1 | docker run -h "oracle" --name "oracle" -d -p 1521:1521 loliconneko/oracle-ee-11g |
docker-compose 启动
oracle.yml
1 | version: '3.1' |
启动
1 | docker-compose -f oracle.yml up |
进入容器
1 | docker exec -it <container_id> /bin/bash |
登录oracle
1 | sqlplus sysdba/oracle |
查看用户
1 | select username,password from dba_users; |
创建用户
1 | create user <user_name> identified by <password>; |
给用户授权
1 | grant connect,resource to <user_name>; |
connect 是保证该用户能连接数据库
resource 是该用户可以使用数据库资源
所有权限
grant all privileges to <user_name>;
删除用户
1 | drop user deque |
链接
1 | jdbc:oracle:thin:@<ip>:<port>:EE.oracle.docker |