1. 程式人生 > >設置PLSQL啟動自動登錄指定數據庫

設置PLSQL啟動自動登錄指定數據庫

幫助文檔 保存 dev 格式 logon param data 項目 wing

設置PLSQL啟動自動登錄數據庫

在做公司的項目中,有多個測試環境,在deubg問題時經常要連不同的數據庫。雖然PLSQL可以保存登錄用戶名和密碼,但是每次選擇的時候在一排數據庫中選擇的時候很容易看花眼,就想有沒有什麽便捷的方法可以直接登錄數據庫。

在看PLSQL的幫助文檔時,發現33.4有這麽一段話:

userid
Every time you start PL/SQL Developer, it will prompt you for at least the password. To avoid this, you can supply a userid parameter with the familiar username/password@database format:
plsqldev.exe userid=scott/tiger@chicago
Note that you can also use the following registry key to supply a default logon:
HKEY_CURRENT_USER\Software\Allround Automations\PL/SQL Developer\Logon
Here you can add a Username, Password and Database.
The last method has the advantage that it enables you to be automatically logged on after double clicking a PL/SQL Developer registered file.

也就是說,在運行plsqldev.exe時,在後面加上“user=登錄信息”參數,PLSQL啟動後就會自動登錄,因此創建帶有不同數據庫連接的PLSQL快捷方式就可以實現這個需求。

打開PLSQL的安裝目錄,右鍵plsqldev.exe,選擇發送到-桌面快捷方式,在桌面上右鍵plsqldev.exe - 快捷方式文件-屬性,在目標的引號後加上數據庫連接信息,格式如下:

user=用戶名/密碼@數據庫地址

技術分享圖片

創建多個快捷方式,每個快捷方式對應一個數據庫,改不同的名字,這樣看起來非常的美觀。
技術分享圖片

設置PLSQL啟動自動登錄指定數據庫