מִצְוַת מְשִׁיחַת כֹּהֵן גָּדוֹל וּמַלְכֵי בֵּית דָּוִד בְּשֶׁמֶן הַמִּשְׁחָה – לַעֲשׂוֹת שֶׁמֶן הַמִּשְׁחָה עַל הָעִנְיָן שֶׁצִּוְּתָה הַתּוֹרָה לַעֲשׂוֹתוֹ שֶׁנֶּאֱמַר (שמות ל כה) וְעָשִׂיתָ אֹתוֹ שֶׁמֶן מִשְׁחַת קֹדֶשׁ וְגוֹ'. שֶׁיִּהְיֶה מוּכָן לִמְשֹׁחַ בּוֹ כָּל כֹּהֵן גָּדוֹל שֶׁיִּתְמַנֶּה כְּמוֹ שֶׁכָּתוּב (ויקרא כא י) וְהַכֹּהֵן הַגָּדוֹל מֵאֶחָיו אֲשֶׁר יוּצַק עַל רֹאשׁוֹ שֶׁמֶן הַמִּשְׁחָה. וְכֵן מוֹשְׁחִין בּוֹ קְצָת הַמְּלָכִים, וְכֵן גַּם מָשְׁחוּ בּוֹ הַכֵּלִים שֶׁל בֵּית הַמִּקְדָּשׁ, וְלֹא יִצְטָרְכוּ לִמְשֹׁחַ לֶעָתִיד אֶלָּא בָּעֲבוֹדָה יִתְקַדְּשׁוּ, וְזֶהוּ שֶׁכָּתוּב (שמות ל לא) יִהְיֶה זֶה לִי לְדֹרֹתֵיכֶם, כֵּן אָמְרוּ זִכְרוֹנָם לִבְרָכָה בְּסִפְרֵי (נשא ז א). The commandment of anointing the high priest and the kings of the House of David with anointing oil: To make the anointing oil according to the way that the Torah commanded to make it, as it is stated (Exodus 30:25), “And you shall make it, a holy anointing oil, etc.” [This is] so that it be ready to anoint every high priest that is appointed, as it is written (Leviticus 21:10), “The priest who is exalted above his fellows, on whose head the anointing oil has been poured.” And so [too], we anoint some of the kings. And so [too,] they also anointed the vessels of the Temple with it, but they will not need to anoint [them] in the future, as they will be sanctified by their service. And this is [the meaning] of what is written (Exodus 30:31), “and it will be for Me for the generations.” And so did they, may their memory be blessed, say in Sifrei Bamidbar 44.
מִשָּׁרְשֵׁי הַמִּצְוָה. שֶׁרָצָה הָאֵל בָּרוּךְ הוּא שֶׁנַּעֲשָׂה פְּעֻלָּה בְּנַפְשׁוֹתֵינוּ בַּיּוֹם שֶׁנַּעֲלָה לְהִתְחַנֵּךְ בִּכְבוֹד עֲבוֹדָתוֹ הַקְּדוֹשָׁה תּוֹרֶה בָּנוּ גְּדֻלָּה וָשֶׁבַח, וְזֶהוּ מְשִׁיחַת הַשֶּׁמֶן, לְפִי שֶׁעִנְיַן הַמְּשִׁיחָה בַּשֶּׁמֶן הַטּוֹב לֹא יַעֲשׂוּהוּ רַק לַמְּלָכִים וְהַשָּׂרִים הַגְּדוֹלִים. וְגַם מִיְּסוֹד הַמִּצְוָה לִהְיוֹתוֹ מוּכָן בַּבַּיִת לְעֵת הַצֹּרֶךְ לְמַעֲלַת הַמָּקוֹם, כִּי יָדוּעַ עַל דֶּרֶךְ מָשָׁל כִּי מִמַּעֲלַת בַּעַל הַבַּיִת הַנִּכְבָּד לִהְיוֹת מוּכָן בַּבַּיִת כָּל הַצָּרִיךְ בָּהּ וְלֹא תִּתְעַכֵּב שָׁם מְלָאכָה עַד הָכֵן הַצָּרִיךְ אֵלֶיהָ. It is from the roots of the commandments that God, blessed be He, wanted us to do an act, ourselves, on the day that we go up to be inaugurated to the honor of His holy service that indicates greatness and praise in us. And that is the anointing of the oil, since only kings and great ministers do the matter of anointing with good oil. And it is also from the foundation of the commandment that it be ready in the [Temple] for the time [it will be] needed, due to the loftiness of the place. As it is known, by way of a metaphor, that it is from the loftiness of an honored patron to have his house ready for every need in it and that no work be delayed until the time it is needed.
דִּינֵי הַמִּצְוָה. כְּגוֹן מַעֲשֵׂה הַשֶּׁמֶן כֵּיצַד נַעֲשָׂה, מֹר קִנָּמוֹן קִדָּה חֲמֵשׁ מֵאוֹת שֶׁקֶל מִכָּל אֶחָד, אֶלָּא שֶׁהַקִּנָּמוֹן נִשְׁקָל בֵּין שְׁתֵּי פְּעָמִים לְהַרְבּוֹת בּוֹ שְׁתֵּי הַכְרָעוֹת, וּקְנֵה בֹשֶׂם חֲמִשִּׁים וּמָאתָיִם שֶׁקֶל, וְכֻלָּם נִמְצָאִים בְּאִיֵּי הֹדּוּ, וְשֶׁמֶן זַיִת שִׁעוּר הִין, שֶׁהוּא שְׁנֵים עָשָׂר לֹג, וְאַחַר זֶה שֶׁיִּתְבַּשֵּׁל הַכֹּל כְּדֵי צָרְכּוֹ חוֹזֵר הַכֹּל לְמִדַּת הַשֶּׁמֶן שֶׁהוּא שְׁנֵים עָשָׂר לֹג, וְסִימָן יִהְיֶה "זֶה" בְּגֵימַטְרְיָא י"ב הָוֵי, וְיֶתֶר פְּרָטֶיהָ בְּפֶרֶק רִאשׁוֹן מִכְּרִיתוֹת. (ה ב) The laws of the commandment — for example, the process of how the oil was made, five hundred shekel [weight] of myrrh, cinnamon and cassia, each, except that the cinnamon is weighed in two [batches] to increase the two [toppings off] with it, and two hundred and fifty shekel of fragrant cane, and they are all found in the Indian islands, and the measure of olive oil is a hin which is twelve log; that after it is all properly cooked, it all comes back to the measure of the oil, which is twelve log, and its mnemonic is zeh (made up of the Hebrew letters zayin, hey), [which] is twelve in its numerical count (gematria); and the rest of its details — are in the first chapter of Keritot.
וְנוֹהֶגֶת בִּזְמַן הַבַּיִת, וְהִיא מִמִּצְוֹת הַמֻּטָּלוֹת עַל הַצִּבּוּר כְּמוֹ בִּנְיַן הַבַּיִת וְכֵלֶיהָ. And [it] is practiced at the time of the [Temple], and it is from the commandments that are impingent upon the community — like the building of the [Temple] and its vessels.