0%

docker拉取

1
2
3
4
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 start oracle11g
docker exec -it oracle11g bash

这条不用,仅记录密码:su root 密码:helowin

修改环境变量

1
2
3
4
5
vi ./.bashrc
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
source ~/.bashrc

通过sqlplus在Oracle数据库创建用户

1
2
3
4
5
6
7
8
[oracle@79def098c093 ~]$ sqlplus /nolog
conn /as sysdba
alter user system identified by system;
alter user sys identified by sys;
create user frank identified by Gzxu2012;
grant connect,resource,dba to frank;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
exit

客户端连接

配置环境变量navicat需要64位驱动,plsqldev需要32位驱动
删1) 变量名:ORACLE_HOME 变量值:C:\app\PLSQLDeveloper\instantclient_11_2
删2) 变量名:TNS_ADMIN 变量值:E:\tool_01\PLSQL Developer\instantclient_11_2
plsqldev需要3) 变量名:NLS_LANG 变量值:SIMPLIFIED CHINESE_CHINA.ZHS16GBK
删4) 修改Path变量,在后面添加 E:\tool_01\PLSQL Developer\instantclient_11_2

通过客户端进行表空间操作

1
2
3
4
5
6
7
8
-- 创建表空间
create tablespace frank_table_space
datafile '/home/oracle/app/oracle/oradata/helowin/frank_table_space.dbf'
size 100M
autoextend on next 10M maxsize 3000M;

-- 删除表空间
drop tablespace frank_table_space including contents and datafiles

导入导出,采用sqlplus支撑

1
2
3
4
--导入导出命令   在装sqlplus机器上
ip导出方式: exp demo/demo@127.0.0.1:1521/orcl file=f:/f.dmp full=y
exp demo/demo@orcl file=f:/f.dmp full=y
imp demo/demo@orcl file=f:/f.dmp full=y ignore=y

运维

1
2
sql> SHUTDOWN IMMEDIATE
sql> STARTUP
1
2
3
4
5
6
7
lsnrctl status

Service "helowin" has 1 instance(s).
Instance "helowin", status READY, has 1 handler(s) for this service...
Service "helowinXDB" has 1 instance(s).
Instance "helowin", status READY, has 1 handler(s) for this service...
The command completed successfully

案例-在线平台

1
2
3
4
5
6
7
8
9
10
11
12
--创建用户
create user FGWCMS identified by Gzxu2012;
grant connect,resource,dba to FGWCMS;

-- 创建表空间
create tablespace WEBSITE
datafile '/home/oracle/app/oracle/oradata/helowin/WEBSITE_table_space.dbf'
size 100M
autoextend on next 10M maxsize 3000M;

-- 删除表空间
drop tablespace WEBSITE including contents and datafiles;
1
2
3
4
5
unzip FGW20181227
docker cp ~/FGW20181227.dmp oracle11g:/home/oracle/
imp frank/Gzxu2012@helowin file=/home/oracle/FGW20181227.dmp full=y ignore=y

会提示importing FGW's objects into FRANK

1. 数据库部分

1.1 docker pull mysql:5.7

1
2
docker run -d -p 3306:3306  -v /data/docker/mysql/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Gz,.9918xu --name mysql mysql:5.7
# 不需要提前创建/data/docker/mysql目录
1
2
3
4
5
# 设置支持utf-8解决方案(已测试有效)
sudo docker exec -it mysql bash
echo "character-set-server=utf8" >> /etc/mysql/mysql.conf.d/mysqld.cnf
exit
sudo docker restart mysql
1
2
3
4
5
6
7
docker exec -it mysql bash
mysql -uroot -p
# 给root设置密码
ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY '123456';
# 添加远程登录用户
CREATE USER 'admin'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%';
1
2
3
4
docker ps -a --no-trunc # ps列出container -a列出全部, --no-trunc不截断
docker stop mysql
docker restart mysql
docker rm mysql
阅读全文 »

windows的话,你需要装一下git bash软件,
然后把bin目录添加到系统环境变量PATH中,你会发现很多linux命令都在windows上可用了。

配置git环境

git config –global user.email “dirsky@126.com
git config –global user.name “frank”
git config –global push.default simple
把RSA.public填写到git远程服务器上

查看配置
git config –global -l

测试

ssh -T git@gitee.com
ssh -T git@github.com

git init

git remote add origin git@github.com:dirsky/sublime-lab.git
git pull origin master

  1. 删除
    git remote rm origin

  2. 添加
    git add .
    git commit -m “init commit”
    git remote add origin git@github.com:dirsky/express-test.git

  3. 建立本地与远程的关联
    git push -u origin master

git config –global alias.acp ‘!f() { git add -A && git commit -m “$@” && git push; }; f’
使用时只需要 git acp “内容”

find . -name ‘*.DS_Store’ -type f -delete
删除项目下的 ds_Store