SQL DCLシ壹す繝弱ル繝

繧キ繝弱ル繝縺ィ縺ッシ

繧ケ繧ュ繝シ繝/髱槭せ繧ュ繝シ繝 繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ィ繧、繝ェ繧「繧ケ(蛻・蜷)
邂。逅閠逕ィ縲髢イ隕ァ閠逕ィ縺ォ讓ゥ髯舌r謖ッ繧雁縺代k遲峨ョ逶ョ逧縺ァ菴ソ逕ィ縺輔l繧九
陦ィ/繝薙Η繝シ/鬆蠎/繧ケ繝医い繝峨サ繝励Ο繧キ繝シ繧ク繝」/繝輔ぃ繝ウ繧ッ繧キ繝ァ繝ウ/繧キ繝弱ル繝
縺ゅ¥縺セ縺ァ蛻・蜷阪
讓ゥ髯舌ョ莉」繧上j縺ォ縺ッ縺ェ繧峨↑縺縲
繝励Λ繧、繝吶シ繝/繝代ヶ繝ェ繝繧ッ蝠上o縺壹∝縺ョ繧ェ繝悶ず繧ァ繧ッ繝医∈縺ョ繧「繧ッ繧サ繧ケ讓ゥ髯舌′辟。縺代l縺ー謫堺ス懊〒縺阪↑縺縲
userA縲「serB縺悟ア繧九→縺励※縲
userA縺ョ繧ケ繧ュ繝シ繝槭↓myTable縺後≠繧九
userB縺ッ縲
SELECT * FROM userA.myTable;
縺ィ蟶ク縺ォ繝ヲ繝シ繧カ繝シ繧呈э隴倥☆繧句ソ隕√′縺ゅk縲

CREATE PUBLIC SYSNONYM mySynonym FOR userA.myTable;

SELECT * FROM mySynonym;
繝サ繝ヲ繝シ繧カ繝シ蜷阪√ユ繝シ繝悶Ν蜷阪r髫阡ス縺ァ縺阪k轤コ縲∽ク闊ャ繝ヲ繝シ繧カ繝シ縺ォ蟇セ縺吶k繧サ繧ュ繝・繝ェ繝繧」縺碁ォ倥∪繧
繝サ繧ケ繧ュ繝シ繝槭ョ螟画峩縺ョ髫帙√す繝弱ル繝縺ョ螳夂セゥ繧貞、画峩縺吶k縺縺代〒貂医

CREATE SYNONYM

繝励Λ繧、繝吶シ繝医す繝弱ル繝
閾ェ蛻蟆ら畑縲ゆス懈占縺励°菴ソ縺医↑縺縲

CREATE SYNONYM (繧キ繝弱ル繝蜷) FOR (繝ヲ繝シ繧カ繝シ蜷).(繧ェ繝悶ず繧ァ繧ッ繝)

繝代ヶ繝ェ繝繧ッ繝サ繧キ繝弱ル繝
DB蛻ゥ逕ィ閠蜈ア譛臥畑

CREATE PUBLIC SYNONYM (繧キ繝弱ル繝蜷) FOR (繝ヲ繝シ繧カ繝シ蜷).(繧ェ繝悶ず繧ァ繧ッ繝)

DROP SYNONYM

繝励Λ繧、繝吶シ繝医す繝弱ル繝
DROP SYNONYM (繧キ繝弱ル繝蜷);

繝代ヶ繝ェ繝繧ッ繝サ繧キ繝弱ル繝
DROP PUBLIC SYNONYM (繧キ繝弱ル繝蜷);

菴ソ逕ィ

繝励Λ繧、繝吶シ繝医す繝弱ル繝縺ッ菴懈占縺ァ縺ゅl縺ー菴ソ逕ィ(謖螳)蜿ッ閭ス縲
繝代ヶ繝ェ繝繧ッ繧キ繝弱ル繝縺ッ蜈ィ繝ヲ繝シ繧カ繝シ菴ソ逕ィ(謖螳)蜿ッ閭ス縲

CREATE SYNONYM 繧キ繝弱ル繝蜷 FOR 繝ヲ繝シ繧カ繝シ蜷.陦ィ蜷
SELECT * FROM 繧キ繝弱ル繝蜷 ス
UPDATE 繧キ繝弱ル繝蜷 ス

菴ソ縺医k(繧キ繝弱ル繝繧呈欠螳壹☆繧)莠九→縲√が繝悶ず繧ァ繧ッ繝医↓蟇セ縺吶k繧「繧ッ繧サ繧ケ讓ゥ髯舌ッ蛻・縲
繧キ繝弱ル繝繧剃ス懈舌@縺溘→縺励※縲√す繝弱ル繝繧剃スソ逕ィ縺ァ縺阪※繧ゅ
繧キ繝弱ル繝縺ョ蜈繧ェ繝悶ず繧ァ繧ッ繝医∈縺ョ繧「繧ッ繧サ繧ケ讓ゥ髯舌′辟。縺代l縺ー繝繝シ繧ソ繧貞叙蠕励〒縺阪↑縺縺ョ縺ァ繧ィ繝ゥ繝シ

Follow me!