oracle - 数据库 SQL



# oracle-21c

https://hub.docker.com/r/fugeritorg/oracle-21-21.3.0-xe-playground

- oracle-11g

https://hub.docker.com/r/yoding/oracle-11g

https://hub.docker.com/r/jaspeen/oracle-11g

https://hub.docker.com/r/yycx/oracle11

https://hub.docker.com/r/hao474798383/oracle-11g



docker run --privileged --name oracle11g -p 1521:1521 -v d:/oracleinstall:/install jaspeen/oracle-11g


-连接到容器

docker exec -it oracle11g /bin/bash

su - oracle

-连接到sql控制台

sqlplus / as sysdba

-解锁账户

alter user scott account unlock;

commit;

conn scott/tiger

-连接oracle数据库

默认的sid为orcl,端口为1521,scott/tiger即可连接 


-修改管理员密码

alter user sys identified by 5208;

alter user system identified by 5208;


-设置密码过期时间为永不过期

Alter PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

-设置密码登录尝试次数为不受限

alter profile default limit failed_login_attempts unlimited;


-创建表空间

CREATE SMALLFILE TABLESPACE "ODB" DATAFILE '/opt/oracle/app/oradata/orcl/ODB1' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

ALTER TABLESPACE "ODB" ADD DATAFILE '/opt/oracle/app/oradata/orcl/ODB2' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED;

--同样设置loong表空间以及用户


-创建用户和密码

create user ODBA identified by 5208 default tablespace ODB;

-添加dba权限

grant connect,resource,dba to ODBA;


-e ORACLE_ALLOW_REMOTE=true -e ORACLE_PASSWORD=testpassword -e RELAX_SECURITY=1

-宽松的密码策略


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回