DBA提交腳步規範

2022-04-28 10:06:10 字數 1323 閱讀 8091

工作中需要走腳步流程,申請修改資料庫,總結一些常用的語句:)

提交時註明為ddl/dml_需求號_日期(各公司標準不一樣)

//修改字段長度使用;

alter table t_task modify task_no varchar2(2000);

//修改欄位名稱

alter table t_task rename column task_no_bak to task_no;  

//修改字段型別, 先新建備份字段 , 然後複製字段資訊, 刪除原欄位

a.alter table t_task add (task_name_bak varchar2(2000));

b.update t_task set task_name_bak = task_name;

c.alter table t_task drop column task_name;

d.alter table t_task rename column task_name_bak to task_name;

//表字段注釋

comment on column version_opr.t_operated_data_log.operated_sql is '執行操作的sql語句';

//授權表 及 建立同義詞 , 建立同義詞為誰使用,誰建立

grant select,insert,update on t_task to tp_task_user;  //授權表

grant select on seq_operated_data_log_id to tp_task_user;  //授權序列

create or replace synonym t_operated_data_log for task_user.t_operated_data_log;  //建立同義詞

create or replace synonym seq_operated_data_log_id for task_user.seq_operated_data_log_id;  //建立同義詞

//建立備份表, 適用:需要update多個字段

create table test01_bak_20161204 as select * from test01 where name in ('kk','cc','hh');//建立備份表

comment on table test01_bak_20161204 is 'test01備份表,16年12月度可刪除';

update test01 t set t.name = 'cc' where exists (select 1 from test01_bak tb where tb.id = t.id) ; //適用備份表更新資料

Git 提交規範

無規矩不成方圓,程式設計也一樣。乙個commit只做一件事情,若乙個commit做了多件事情需要拆分成多個commit 嚴格遵循commit message格式 每次只允許提交乙個commit,若本地有多個commit等待提交,必須等前面的commit合併進入主版本庫並在本地合併完成後才可提交後面的...

Git提交規範

type為必填項,用於指定commit的型別,約定了feat fix兩個主要type,以及docs style build refactor revert五個特殊type,其餘type暫不使用。主要type feat 增加新功能 fix 修復bug 特殊type docs 只改動了文件相關的內容 s...

GIT提交message規範

type 用於說明 commit 的類別,只允許使用下面7個標識。feat 新功能 feature fix 修補bug docs 文件 documentation style 格式 不影響 執行的變動 refactor 重構 即不是新增功能,也不是修改bug的 變動 perf 效能優化 test 增...