拉取镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
创建容器
docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
查看容易
docker ps -a
进入容器
docker exec -it oracle11g bash
切换root登录
su root
#密码:helowin
修改环境变量
vi /etc/profile
添加已下内容
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
保存 ::wq
让配置生效:source /etc/profile
创建软链
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
切换用户
su - oracle
登录数据库
sqlplus /nolog
connect /as sysdba
修改默认密码
SQL> alter user system identified by system;
User altered.
SQL> alter user sys identified by sys;
User altered.
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Profile altered.
SQL>
创建新用户:
create user gdlisnet identified by gdlisnet;
create user
创建表空间
create tablespace gdlisnet datafile '/home/oracle/app/oracle/oradata/helowin/gdlisnet.dbf' size 500m autoextend on next 50m maxsize 20480m extent management local;
挂载表空间
alter user gdlisnet default tablespace gdlisnet;
给新用户权限
grant connect,resource,dba to gdlisnet;
Windows修改远程oracle网络管理器 net manager
默认服务名称为helowin Sid helowin
修改服务名&修改字符集
查看当前实例名
echo $ORACLE_SID
返回为空时执行一 source ~/.bash_profile 不然 进不去sqlplus
登录sqlplus
sqlplus / as sysdba
查看实例
select instance from v$thread;
关闭数据库
shutdown immediate
关闭数据库
exit
修改/etc/oratab文件,将sid名由旧的修改为新的,如从helowin修改为servername
cat /etc/oratab
进入到$ORACLE_HOME/dbs目录
将所有文件名中包含原来的helowin的修改为对应的新servername的
修改环境变量中的sid
vi ~/.bash_profile
使新修改的ORACLE_SID环境变量生效
. ~/.bash_profile
启动数据库
sqlplus / as sysdba
startup
检查数据库实例名
select instance from v$thread;
修改服务名
alter system set service_names='servername' scope=both;
修改字符集
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
SHUTDOWN IMMEDIATE;
STARTUP;
字符集修改完成
翻译
搜索
复制
标签:helowin,修改,ORACLE,oracle,docker,gdlisnet,ALTER From: https://www.cnblogs.com/xiaobaishiyi/p/17956802