Why does Toad execute the scripts in glogin.sql or login.sql every time I use F5 (Run as Script)?
The written documentation from Oracle states that the glogin.sql and login.sql are executed each time a user connects or reconnects to a database.
The glogin.sql and login.sql are executed whenever a user executes a script with the F5 (Execute as Script). F5 emulates SQL*Plus, and this would be the reason for the description for the "Execute login scripts" functionality. It does work slightly differently than SQL Plus in that it is executes every time the F5 (Execute as Script) is used.
The order of execution is reset, glogin.sql, and then login.sql.
As a workaround on this issue, manually uncheck or check the "Execute Login Scripts" in the Toad Options. When the said option is checked, the scripts are run; when it is not checked, the scripts are not run. This can be inconvenient, but there is a Toad Options Icon right below the File Menu Bar. To see how the icon looks, go to View menu | Toad Options | the icon is displayed in there. Toad also remembers the last options changed so it should be just about a three click process when you want to change the setting. You also do not need to restart Toad or the Editor window for the settings to take effect.