本sql 腳本,目的是,將組織機(jī)構(gòu)內(nèi)的人員登錄名從 a 改成 a1 ,人員數(shù)據(jù)庫(kù)是 OIOrg (根據(jù)自己設(shè)置情況落實(shí))
很多 登錄名是中的情況下,我們將中文登錄名 移入到別名,為這個(gè)賬號(hào) 建立一個(gè) 英文登錄名
1)請(qǐng)核對(duì),人員管理服務(wù)所用到的數(shù)據(jù)庫(kù)是否是 OIOrg ;
2)運(yùn)作這個(gè)腳本的時(shí)候,必須是在OIOrg這個(gè)數(shù)據(jù)庫(kù)內(nèi)進(jìn)行腳本運(yùn)行;
3)在OIOrg庫(kù)下,先創(chuàng)建sheet1表,包含 newlogin oldlogin 2個(gè)字段;(若有excel也可以導(dǎo)入)
4)運(yùn)行此腳本前,先將 OIOrg庫(kù)進(jìn)行備份;
5) 這個(gè)腳本運(yùn)行后 ,重啟所有服務(wù),才能生效
— 管理員表 — OI_Org_T004.S_C1
UPDATE OI_ORG_T004
SET S_C1 = A.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T004.S_C1
GO
— 單位負(fù)責(zé)人表 — OI_Org_T006.S_C4
UPDATE OI_Org_T006
SET S_C4 = A.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T006.S_C4
GO
— 人員組成表 — OI_Org_T007.S_C3
UPDATE OI_Org_T007
SET S_C3 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T007.S_C3
GO
— 人員登記信息表 — OI_Org_T008.S_C1
UPDATE OI_Org_T008
SET S_C1 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T008.S_C1
GO
— 人員擴(kuò)展標(biāo)簽信息表 — OI_Org_T009.S_C1
UPDATE OI_Org_T009
SET S_C1 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T009.S_C1
GO
— 角色人員表 — OI_Org_T011.S_C2
UPDATE OI_Org_T011
SET S_C2 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T011.S_C2
GO
— 視圖人員表 — OI_Org_T013.S_C3
UPDATE OI_Org_T013
SET S_C3 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T013.S_C3
GO
— 視圖可訪問(wèn)控制表 — OI_Org_T015.S_C3 (N_C2 = 0)
UPDATE OI_Org_T015
SET S_C3 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T015.S_C3
AND OI_Org_T015.n_C2 = 0
GO
— 應(yīng)用可使用人員表 — OI_Org_T017.S_C3 (N_C2 = 0)
UPDATE OI_Org_T017
SET S_C3 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T017.S_C3
AND OI_Org_T017.n_C2 = 0
GO
— 領(lǐng)導(dǎo)關(guān)系表 (可能很多用戶都沒(méi)有用到)– OI_Org_T025.S_C1
UPDATE OI_Org_T025
SET S_C1 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T025.S_C1
GO
–領(lǐng)導(dǎo)關(guān)系表 — OI_Org_T025.S_C2 (N_C5 = 0)
UPDATE OI_Org_T025
SET S_C2 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T025.S_C2 AND OI_Org_T025.n_C5 = 0
GO
— 常用聯(lián)系人分組 OI_ORG_CONTACT_GROUP
UPDATE OI_ORG_CONTACT_GROUP
SET S_OWNER = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_CONTACT_GROUP.S_OWNER
GO
— 常用聯(lián)系人 OI_ORG_CONTACT
UPDATE OI_ORG_CONTACT
SET S_OWNER = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_CONTACT.S_OWNER
GO
UPDATE OI_ORG_CONTACT
SET S_USER_LOGIN = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_CONTACT.S_USER_LOGIN
GO
/*
— 用戶關(guān)注表 (這個(gè)已經(jīng)被注釋掉了,這個(gè)表現(xiàn)在還沒(méi)有用到)– OI_Org_T026.S_C1
UPDATE OI_Org_T026
SET S_C1 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T026.S_C1
GO
— OI_Org_T026.S_C2
UPDATE OI_Org_T026
SET S_C2 = a.newlogin
FROM sheet1 a WHERE a.oldlogin = OI_ORG_T026.S_C2
GO