Upload
trinhtuong
View
238
Download
4
Embed Size (px)
Citation preview
Documentation
TableofcontentsUserTableofContents
InstallationApplicationWindowOverview(ApplicationWindowOverview)Views
DatabaseNavigator(DatabaseNavigator)FilterDatabaseObjects(FilterDatabaseObjects)ConfigureFilters(ConfigureFilters)
ProjectsProjectExplorer(ProjectExplorer)
DatabaseConnections(DatabaseConnections)ConnectingtoDatabases(ConnectingtoDatabases)EditingConnections(EditingConnections)
DatabaseObjectEditor(DatabaseObjectEditor)PropertiesTab(PropertiesTab)DataTab(DataTab)ERDiagramTab(ERDiagramTab)
DataeditorFilters(Data-filter)WorkingwithXML(WorkingwithXML)
SQLEditorClientsidecommands(Client-side-scripting)SQLTemplates(SQL-Editor-Templates)
Databasedrivers(Databasedrivers)SQLdatabasesNoSQLdatabases
MongoDB
Cassandra(NoSQL-Cassandra)Redis(NoSQL-Redis)
OptionalextensionsOfficeSVGformat
MiscellaneousDiagrams(ERD)QueryManagerDatatransfer(export/import)(Data-transfer)Data/metadatasearch(Database-Search)Databasecompare(Database-compare)
Command-LineEnterpriseEdition(EnterpriseEdition)ProjectsManagement
AdminGuide
ManagingconnectionsManagingdrivers
Development
DevelopinEclipseFeaturesstructure
Troubleshooting
ResetworkspacePostingissuesLogfilesThreaddump
TheinstallationprocessdependsonthedistributiontypeandyourOperationalSystem-seehttps://dbeaver.jkiss.org/download/(https://dbeaver.jkiss.org/download/)
TheinstallerdistributionistherecommendedwaytoinstallDBeaveronWindowsandMacOSX.ItisthemostlightweightduetoanadvancedarchivingtechnologythatisusesandthatisnotavailableinthecaseoftheZIParchive.Besidesthis,theinstallerautomaticallyupgradesDBeavertothenewversion,ifapreviousversionisalreadyinstalled.ToinstallDBeaver,runtheinstallerexecutableandfollowtheinstructionsinitsscreens.
NOTE:
TheinstallerdoesnotchangeanysystemsettingsortheJavainstallation.
TheIncludedJREwillbeaccessibleonlyforDBeaver.
WheninstallingDBeavermanually,withoutusinganinstaller:
1. InstallJava1.8(http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)asaseparatestep.
2. Extractthecontentsofthearchive.NOTE:DonotunzipthearchiveoverapreviousDBeaverversion.IfyoualreadyhaveanyversionofDBeaverextractedinthesamelocation-removeitbeforeunzippingthenew
Installation
Windows/MacOSInstaller
ZIPArchive
version.NOTE:Allconfigurations,scriptsandothernecessarydataarestoredinaseparatelocation(usuallyintheuser`shomedirectory)sotheprogramdeinstallationwillnotaffectthem.
3. Runthedbeaverexecutable.
ToinstallDBeaverusingaDebianpackage:
1. Run sudodpkg-idbeaver-<version>.deb .
2. Execute dbeaver& .
ToinstallDBeaverusinganRPMpackage:
1. Run sudorpm-ivhdbeaver-<version>.rpm .
2. Execute dbeaver& .
NOTE:ToupgradeDBeavertothenextversion,use sudorpm-Uvhdbeaver-<version>.rpm parameter.
YoucouldtryDMGorZIParchiveifyoucan'tusePKGinstallerforsomereason.ToinstallDBeaveronMacOS,justdrag-and-droptheDMGarchivetoyourdisk.NOTE:DBeaverrequiresJava1.8tobeinstalled,soyouneedtoinstallJDK1.8+(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)priortoinstallingDBeaver.
DebianPackage
RPMPackage
MacOSDMG
Youcanalsousebrew(http://macappstore.org/dbeaver-community/):
brewinstallCaskroom/cask/java
Viewsarewindowswithintheworkspacethatprovidepresentationsandwaystonavigatetheinformation.ThemainviewsinDBeaverare:DatabaseNavigator(https://github.com/serge-rider/dbeaver/wiki/Database-Navigator),Projects(https://github.com/serge-rider/dbeaver/wiki/Projects)andProjectExplorer(https://github.com/serge-rider/dbeaver/wiki/Project-Explorer).
Toopenaview:
OntheWindowmenu,clickShowViewandthen,onthesubmenu,clickthenameoftheview.ClickOtheriftheviewisnotvisibleonthesubmenu.
ForDatabaseNavigator,Projects,andProjectExplorerviews,ontheWindowmenu,justclickthenameoftheview.
Someviewsopenondemand,forexampletheSearchviewopenstoshowsearchresults.
Viewsprovidetheirowntoolbarandmenu:
Views
Toopentheviewmenu,clicktheViewMenubuttonintheupper-rightcorneroftheview`stitlebar,nexttotheMinimizebutton.
Thetoolbarcontainsbuttonsapplicabletotheobjectsdisplayedintheview.Thesetofenabledanddisabledbuttonsdependsontheobjectinfocus.
Viewsalsoprovidecontextmenusforobjectstheydisplay.Toopenacontextmenuforanobject,right-clicktheobject.
Youmightneedtoclassifyandgroupdatabaseconnectionsintoprojects.Projectsstoreobjectsrelatednottoaparticulardatabasebuttoalldatabaseconnections.Theseareusuallyfilesstoredonthefilesystem.
TheProjectsviewdisplaysallprojectscreatedinthesystemandprovidestoolstomanagethem.ToopentheProjectsview,ontheWindowmenu,clickProjects(oruse ALT+W+P shortcut).
ProjectsProjects
Forinformationonhowtochangetheviewlayout,pleaseseetheApplicationWindowOverview(https://github.com/serge-rider/dbeaver/wiki/Application-Window-Overview)article.
Theprojectsareorganizedintoatreeandallhavethesamehigh-levelstructure:
Connections–repeatthecontentoftheDatabaseNavigatorviewforthisproject.YoucanperformthesameactionsovertheobjectsofthedatabasesasinDatabaseNavigator.
Bookmarks–containsbookmarks–shortcutstodatabaseobjects,see…
ERDiagrams-containsERdiagramsthatyoucandrag-and-dropherefromotherfolders
Scripts–containsscriptsthatyoucandrag-and-dropherefromotherfolders
TheProjectsviewprovidesatoolbarandViewmenuwhichcontaingenericitems.Eachobjectinthetreehasitsowncontextmenu.
ToopentheviewmenuoftheProjectsview,clicktheViewMenubutton( )intheupper-rightcornerofthewindow.Theviewmenucontainsthefollowingitems:
Icon Item Description
CreateProject OpenstheCreateProjectwizard
RefreshProjects
Refreshestheprojectstreetodisplaychangescausedbycreatingmodifyingordeletingprojects
CollapseAll Collapsesthetreetotherootlevel
Linkwitheditor
-Enabledwhenatleastoneeditorisopen,otherwisedisabled-Highlightstheobjectinthetreethat
hasitseditoropen
Thetoolbarislocatedinthetitlebarofthewindow,itsbuttonsduplicatetheviewmenuitemsexceptfortheRefreshProjectsone.
Toopenthecontextmenuforanobjectinthetree,right-clicktheobject.ForinformationaboutcontextmenuitemsofallobjectsundertheConnectionsnodeofthetree,pleaseseeDatabaseNavigator(https://github.com/serge-rider/dbeaver/wiki/Database-Navigator).Thecontextmenusofothernodesinthetreecontainsomebasicitemsforcopy-pasting,renaming,deletingobjects,managingtheirproperties,creatingfolders,etc.
TheSetActiveProjectmenuitem(foraprojectrootnode)makestheprojectactive,thatisvisibleintheDatabaseNavigator.
TheLinkFile(SQLScript)andLinkFoldermenuitemsallowcreatinglinkstofilesandfoldersinthefilesystem.
TheProjectsviewallowscreatingnewprojectsaswellasrenaminganddeletingprojectsthatarenotactive.NOTE:Youcannotrenameordeleteaprojectthatissetasactive.
Tocreateaproject,intheProjectsview,inthetoolbar,clickCreateProject( ).TheProjectCreateWizardopens.
ManagingProjects
CreatingProject
TBA
Todeleteaproject,intheProjectsview,right-clickitsnameinthetreeandclickDeleteonthecontextmenu.Twoconfirmationdialogboxesappearoneafteranother:
1. Deleteobjectdialogboxistoconfirmthedeletionoftheprojectitself.ClickYesifyouaresureyouwanttodeleteit.Otherwise,clickNo.
2. Deleteprojectdialogboxistoconfirmthedeletionoftheproject`scontents:thesearethedatastoredinthefilesystem,databaseconnectionsarenotaffected.ClickYesif
DeletingProject
youwantthecontentstobedeletedaswell.Tokeepthecontents,clickNo.
NOTE:Ifyouhavedeletedaprojectandthenre-createitwiththesamename,thenewprojectpicksupallthedatabaseconnectionsofthedeletedproject.
Bookmarksarequickaccesslinkstoobjectsofadatabase.TheyappearintheprojecttreeinsidetheProjectsorProjectExplorerviews.
Tocreateabookmark:
1. IntheDatabaseNavigatororunderConnectionsnodeoftheProjectsview,clickthedatabaseobjectofinteresttosetfocusonit.
2. Press CTRL+d .TheBookmarkNamedialogboxappears.
3. IntheBookmarkNamefield,enterthebookmarkname,thenintheBookmarkfolderfield,clickthefolder,andthenclickOK.Thebookmarkappearsintheselectedfolderoftherelatedproject.
Toopenanobjectusingitsbookmark,double-clickthebookmarkorright-clickitandclickOpenBookmarkonthecontextmenu.Youcanrenameanddeletebookmarksusingthecontextmenuaswell.
ManagingBookmarks
TheDataeditorappears:
AstheDatataboftheDatabaseObjectEditor(https://github.com/serge-rider/dbeaver/wiki/Database-Object-Editor)availableonlyfortablesandviews.
AstheResultstabwhenyourunacustomSQLqueryinSQLEditor(https://github.com/serge-rider/dbeaver/wiki/SQL-Editor)
TheDataeditorallowsviewingandeditingthedataofadatabasetableorview.ThecentralpartoftheDataeditoristhedatatable.Theeditoralsoprovidestwotoolbarsandafilterfield:
Everycellinthedatatablehasacontextmenu–right-clickthecelltoopenthemenu.Thecontextmenuprovidesthefollowingitems:
MenuItem Description
Cutsthecontentofthecurrentcellor
Dataeditor
Cut columntotheclipboard
Copy Copiesthecontentofthecurrentcellorcolumntotheclipboard
AdvancedCopy
Opensadvancedcopysubmenuthatallowscopyingdatawithpresetformattingparameters
Paste Pastesthecopiedcontenttothecellsinfocus
AdvancedPaste
Pastesseveralvaluesdelimitedwithatabulationorlinebreak
Delete
DeletestherowthathasthecellinfocusNOTE:Infact,whenusersclickDelete,thesystemonlyhighlightstherowredwhiletheactualdeletionhappenswhenusersclickSave.
Editcell
-ForCLOB/BLOBdataformat,opensthecontentsofthecellinanewtab-ForallformatsexceptCLOB/BLOB,opensapropertieswindowforthecell
Inlineedit -Sameasdouble-clickonacell-Makesthecelleditable
SettoNULL SetsthevalueofselectedcellstoNULL
HidecolumnHidesthecolumncurrentlyinfocus,seetheManagingDisplayofColumnsinDataTablesectionfurtherinthisarticle
Savetofile…
-AppearsonlyforcolumnswithBLOB/CLOBdata-OpensthestandardSaveAswindowthatallowssavingdatacontainedinthecelltoafile
Loadfromfile…
-AppearsonlyforcolumnswithBLOB/CLOBdata-Opensastandardwindowforopeningfiles
Order/Filter
Displaysasubmenuthatallowsselectingfiltercriteriaforthedata.Thesubmenucontainsthemostcommonfiltersthatcanbeappliedtothecellinfocus–seedetailsin…Bydefault,DBeaverfiltersdatabysendingarequesttotheserver(theServer-sideresultsorderingcheckboxselected).TofilterdataontheclientsideusingDBeaver`sinternalalgorithm,clearthecheckbox.
View/FormatOpensasubmenuthatprovidestoolsforformattingandmodifyingtheviewofdata,see…
Navigate Opensasubmenuthathelpsusersnavigatethroughoutthedatatable,see…
Layout Changesthelayoutofdata,see…
Export
OpenstheDataTransferwizardthatguidesyouthroughthestepstoselectaformatandexportdataNOTE:Thesystemexportsthewholeresult
Resultset… setincludingrecordsthatarenotvisibleinthescreenandpreservesallapplieddatafiltersandordering.
GenerateSQL
OpensasubmenuonwhichyoucanselectthetypeofSQLquerytogenerate
Refresh Refreshesthewholeresultssetincludingallitemsthatarenotvisibleinthescreen
YoucancreatemultipleSQLscriptsforasingleconnection.EveryscriptopensinitsownSQLeditor.ToopenanSQLeditorforsomeconnection:
ClickthisconnectionintheDatabaseNavigator(https://github.com/serge-rider/dbeaver/wiki/Database-Navigator)viewandpress F3 orclickSQLEditor->SQLEditoronthemainmenu.Alternatively,youclickSQLEditoronthecontextmenuofthisconnection.DBeaveropenstheChooseSQLscriptwindowwithsavedSQLscriptslinkedtothisconnection.CLicktheSQLscripttoopenitinaseparatetab.
ClickRecentSQLEditoronthecontextmenuforthisconnectionoronthemainmenu(SQLEditor->RecentSQLEditor).ThisopensthelatestusedSQLeditor.YoucanalsoopenthemostrecentSQLeditorusing Ctrl+EntershortcutintheDatabaseNavigatorview.
IfyouneedtocreateanewSQLscript,onthemainmenu,clickSQLEditor->NewSQLEditororpress F3 andthenclickNewScriptintheChooseSQLScriptwindow.
DBeaverusesSQLsyntaxhighlightingwhichdependsonthedatabaseassociatedwiththescript.Differentdatabaseshavedifferentsetsofreservedkeywordsandsystemfunctions.
NOTE:SQLEditorforaconnectionisdifferentfromSQLconsoleforatableorview(right-clickthetableandclickReaddatainSQLconsole)inthat,unliketheconsole,itcansavescriptsandchangestothem.
SQLEditor
YoucanseeallyoursavedSQLscriptsintheProjectExplorer(https://github.com/serge-rider/dbeaver/wiki/Project-Explorer)viewintheScriptsfolder.
TheSQLeditorincludesthescriptpaneatthetopandresultspaneatthebottom:
Theresultspanedisplaystabswithresultsinvariousformats.ThetabsresultingfromscriptexecutionrepresentinstancesoftheDataEditor(https://github.com/serge-rider/dbeaver/wiki/Data-Editor).Youcancreate,editandexecuteSQLscriptsinthescriptpaneandthenseetheresultsintheresulttabs.
Totoggle(hide/show)theresultspane,press F6 .
Tomaximizetheresultspane,press Shift+F6 ordouble-clicktheresultstabname.
ResultsPane
Toswitchbetweenthescriptpaneandtheresultspane,pressAlt+F6 .
TheresultspaneprovidesOutputandLogviewsofresults.
TheexecutionLogtabcontainsallqueriesexecutedinthecurrentSQLeditor:
TheOutputtabcontainsallserver-sidedatabasemessages/warningsgeneratedbyadatabasewhenyouexecutequeries.Thisfeatureissupportedonlybyafewdatabaseengines(Oracle,SQLServerandsomeotherones).
Youcanpress Ctrl andmovemouseoverSQLtext.IfDBeaverrecognizessomeidentifierasatable/viewnamethenitpresentsitasahyperlinkwhichwillnavigatetothisobject`seditor.
TochangetheconnectionassociatedwiththecurrentSQLeditororchangetheactivedatabase/schema,usethecomboboxesinthemaintoolbar:
Hyperlinks
ActiveDatabase/SchemaSelection
Youcantoggleauto-commitmodeandtransactionsisolationlevelontheDatabasemenuorinthemaintoolbar:
TransactionsManagement
Note:MongoDBextensionisavailableonlyinEnterprise-Editionversion.
Youcanview/editMongocollectionscontentasstandardrelationaltables(grid/plaintextpresentations)orasJSONdocuments.PresentationcanbeswitchedintheResultsViewertoolbar.IngridDBeaverwilltrytounifyalldocumentsinsomeparticularcollection(astheyhavethesamestructure/thesamesetofproperties).
JSstatementscanbeexecutedinSQLeditorasusual.Mongoscriptingreference(https://docs.mongodb.com/v3.0/administration/scripting/)Followingexamplecreatesauserinthecurrentdatabase.
db.createUser({user:"testuser",pwd:"test",roles:[]})
Thisexamplereturnsalldocumentsincollection'test_col':
db.test_col.find().toArray()
MongoDB
BrowsingMongocollections
ExecutingJS
Note:scriptwillbeexecutedinthecurrentdatabase.Youcannotsetexplicitdatabasenameinyourquery.CurrentdatabasecanbechangedinSQLEditortoolbarorinDatabaseNavigator.
YoucanusestandardSQLstatements(SELECT,INSERT,UPDATE,DELETE)tomanipulateMongodata.
SELECT*FROMtest_colWHEREpropName.subProp='value';
UPDATEFROMtest_colSETpropsName.val1=123WHEREpropName.subProp='value'
NestedJSONpropertiescanbedividedbydot.
ExecutingSQL
ThisextensionsupportsdataexportinOfficeformats(XLS).
ItisincludedinEEversion.
1. Mainmenu Help->InstallNewSoftware
2. InstallOfficeextension.YoucandothisfromonlineEclipseMarketplace(https://marketplace.eclipse.org/content/dbeaver-office-integration(https://marketplace.eclipse.org/content/dbeaver-office-integration)).Oryoucandothismanually:
Paste https://dbeaver.jkiss.org/update/office/latest/ intoWorkwith fieldandpress Enter
Check DBeaverExtension->DBeaverOfficeExtension item
3. ClickNext->Finish.RestartDBeaver.
Note:thisworksonlyifDBeaverversionmatchesOfficeextensionversion(e.g.latest).
Office
InstallationinCEversion:
ThisextensionsupportsdataexportinOfficeformats(XLS).
ItisincludedinEEversion.
1. Mainmenu Help->InstallNewSoftware
2. InstallOfficeextension.YoucandothisfromonlineEclipseMarketplace(https://marketplace.eclipse.org/content/dbeaver-svg-support(https://marketplace.eclipse.org/content/dbeaver-svg-support)).Oryoucandothismanually:
Paste https://dbeaver.jkiss.org/update/svg/latest/ into Workwith fieldandpress Enter
Check DBeaverExtension->DBeaverOfficeExtension item
3. ClickNext->Finish.RestartDBeaver.
Note:thisworksonlyifDBeaverversionmatchesOfficeextensionversion(e.g.latest).
SVGformat
InstallationinCEversion:
EntityRelationDiagrams(ERD)aregraphicpresentationsofdatabaseentitiesandrelationsbetweenthem.DBeaverallowsviewingdiagramsofexistingtablesandwholedatabaseschemas,seeDatabaseStructureDiagrams(https://github.com/serge-rider/dbeaver/wiki/Database-Structure-Diagrams),aswellascreatecustomdiagrams,seeCustomDiagrams(https://github.com/serge-rider/dbeaver/wiki/Custom-Diagrams)
Bothtypesofdiagramsprovidethesametoolstoadjusttheirviewandstructure.Theycanbeprintedandexportedtoimagefileformats.
NOTE:Allchangestoexistingdatabaseschemascannotbesavedandareintendedforexplorationpurposesonly.Youcandothefollowingstructurechangesindiagrams.
Addnewtablestoadiagrambydrag-n-droppingthemontothediagramfieldfromtheDatabaseNavigator(https://github.com/serge-rider/dbeaver/wiki/Database-Navigator).
Rearrangetablesinthediagrambydraggingthemalloverthespace.Youcanselectseveraltablesanddragthemtoanewlocation.
Auto-arrangetablesintoacompactviewaftermanualrearrangements:clicktheArrangeDiagram( )inthetoolbaroronthecontextmenu(right-clickanywhereonthediagramtab).
Diagrams(ERD)
StructureAdjustment
(AvailableforCustomDiagrams(https://github.com/serge-rider/dbeaver/wiki/Custom-Diagrams)only)-connecttableswithaconnector:clicktheShowPalettebutton( )intheupper-leftcornerofthediagramtabandthen,inthePalettepanel,clickConnection.Nowclickthetablesthatyouwanttoconnectwitheachotherinturnonebyone,andthentostoptheconnectionlinedouble-clickingthelasttable.
(AvailableforCustomDiagrams(https://github.com/serge-rider/dbeaver/wiki/Custom-Diagrams)only)-removetables:right-clickthetableandclickDeleteonthecontextmenu.
Youcanadjusttheviewofanydiagraminthefollowingways:
Enable/disablethediagramgrid:ClickToggleGrid( )inthetoolbar.
Modifyattributesvisibility:Right-clickthediagramand,onthecontextmenu,clickShowAttributesandthenoneoftheoptions:
All-allattributes
Anykeys-primaryandforeignkeys
Primarykey-onlyprimarykeys
None-noattributes
Modifyattributespresentation:Right-clickthediagramand,onthecontextmenu,clickAttributeStylesandthenoneoftheoptions:
ViewAdjustment
ShowIcons
ShowDataTypes
ShowNullability
ShowComments
Changethecolorofentities/notes:Right-clicktheheaderoftheentityorcommentandthenclickSetcoloronthecontextmenu.ThenyoucanselectthecolorandclickOK.
Forelementslocatedinfrontof/behindothers,bringanelementtofrontorsendtoback:Right-clicktheelementandthenclickBringtofront/Sendtobackonthecontextmenu.
Zoomthediagramin/out:ClicktheZoomIn/ZoomOutbuttonsorchoosethescalingvalueinthedropdownlistinthetoolbar:
Toseechangesmadetothedatabaseschemabyotherusers,youmightneedtorefreshthediagram:clickRefreshDiagram( )inthetoolbar.
YoucancreatenotesonlyinCustomDiagrams(https://github.com/serge-rider/dbeaver/wiki/Custom-Diagrams).Tocreateanote,clicktheShowPalettebutton( )intheupper-
Refresh
NotesCreation
leftcornerofthediagramtab,then,inthePalettepanel,clickNoteandthenclickanywhereinthediagramtab.Nowyoucandouble-clickNoteboxtoenterthenotetext.
Tosearchamongentitiesofadiagram,clicktheSearchitemsbutton( )inthetoolbar,thentypeinthesearchcombination.Theentitiesthatcontainthesearchcombinationarehighlightedinthediagram.Toremovethefilter,clickthecrossiconnexttothesearchfield.
Youcanexport(save)adiagramasanimage(PNG,GIF,BMPformats)orasafileinGraphMLformat.Toexportadiagram,clickSavediagraminexternalformat( )inthetoolbar.
Toprintadiagram,press CTRL+P orclickPrintDiagram( )inthetoolbar.
Tomodifythediagramsettings,clickConfiguration( )inthetoolbar.
SearchinDiagramEntities
DiagramExport
DiagramPrinting
Settings
IntheQueryManagerviewyoucanseeallSQLqueriesDBeaverexecutes.
DBeaverlogseveryqueryyouexecute.Youcanseeallpreviouslyexecutedqueriesinthespecialview“QueryManager”.Youcanopenitthroughmainmenu“Window->ShowView”.
Youcanseequeryexecutionstatistics(executiontime,numberoffetched/updatedrows,errors,etc).
EEversionpersistsallexecutedqueriesintheinternaldatabasesoexecutionhistoryisavailableafterprogramrestart.
BydefaultQMshowsonlyqueriesexplicitlyexecutedbyuser(inSQLeditororinDataEditor).Youcanconfigurelogsvisibility,monitormetadatareadingqueries,utilitySQL,etc.QMconfigurationavailableinglobalpreferences.
QueryManager
Commandlineparametersmightbepasseddirectlytodbeaver[.exe]executable.OnWindowsyoualsocanuse dbeaver-cli.exe executable(itdoesn'tspawnnewwindowsoyoucanseeoutputmessages).
Name Value Example
-help Printshelpmessage
-stop QuitsDBeaver
-dump PrintsDBeaverthreaddump
-f OpensfileinDBeaverUI-fc:\some-
path\some-
file.sql
-con OpensdatabaseconnectioninDBeaverUI
Seeconnectionparameterstable
-closeTabs Closesallopeneditortabs
-disconnectAll Closesallopenconnections
Forcereuseofsingle
Command-LineCommandlineparameters
DBeavercontrol
-reuseWorkspace
workspacebymultipleDBeaverinstances
-newInstance
ForcenewDBeaverinstancecreation(donottrytoreusealreadyrunningone)
Name Value Example
-nl Locale en_US
-data Workspacepath c:\ProgramData\MyWorkspace
-nosplash
Omitssplashscreen true
-clean
ClearsallEclipsecaches.UseitifDBeaverfailstostartafterversionupgrade.
-vmargs VMparameters SeeVMargumentstable
Systemparameters
VMarguments
YoucanpassanyadvancedJavaparameterssupportedbyyourlocalJVM(Oracle,OpenJDK,IBM,etc).ParameterssupportedbyOracleJVM(1.8):https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html(https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html)
ParameterssupportedbyallJVMs:
Name Value Example
-Xms SetsinitialmemoryavailableforDBeaver
-
Xmx1000m
-Xmx SetsmaximummemoryavailableforDBeaver
-
Xmx4000m
Allconnectionparametersmustbesuppliedasasinglecommandlineargument,parametersaredividedbypipe( | ).Parameternameandvaluearedividedby = .Example:-condriver=sqlite|database=C:\db\SQLite\Chinook.db|name=SQLiteChin|openConsole=true|folder=SQLite
Name Value Example
name Connectionname Testconnection
driver DrivernameorID driver=sqlite , driver=mysql ,etc
ConnectionURL.Optional
Connectionparameters
url(JDBCURLmaybeconstructedbydriverfromotherparameters)
url=jdbc:sqlite:C:\db\SQLite\Chinook.db
hostDatabasehostname(optional)
host=localhost
port
Databaseportnumber(optional)
port=1534
server
Databaseservername(optional)
server=myserver
database
Databasenameorpath(optional)
database=db-name
user Username(optional) user=root
passwordUserpassword(optional)
password=mysecret
Donotaskuse
savePassword passwordonconnect
savePassword=true
connectConnecttothisdatabase
connect=false
openConsole
OpenSQLconsoleforthisdatabase(setsconnect totrue)
openConsole=true
folderPutnewconnectioninafolder
folder=FolderName
autoCommit
Setsconnectionautocommitflag(defaultvaluedependsondriver)
autoCommit=true
prop.propName
Advancedconnectionparameters(dependondriver)
prop.connectTimeout=30
Thisguidedescribeshowtomanage/secureDBeaverdatabaseconnections.ItisdesignedforSystemadministrators.Regularusersshouldcheckthisguide.
DBeaverkeepsinformationaboutprojectconnectionsinfile.dbeaver-data-sources.xml .Youcanfinditinprojectfolder(bydefaultallprojectsresideinworkspace,defaultworkspacelocationis %HOMEPATH%\.dbeaver4 (or ${HOME}/.dbeaver4 ).Defaultprojectfolderis %HOMEPATH%\.dbeaver4\General .
DBeavercanloadmultipleconnectionfiles.Anyfilesinprojectfoldermatching .dbeaver-data-sources*.xml patternwillbeloadedonstartup.Soyoucancreateafile,say, .dbeaver-data-sources-2.xml intheprojectfolderandDBeaverwillseeit.
YoucanimportconnectionfromCSVorXMLfiles.
CSVfilemusthaveaheaderrow(firstlineoffile)withcolumnnames(seelistofsupportedcolumnsbelow).XMLfileshouldcontaintop-levelelementandasetofnestedelements.Connectionsconfigmustbespecifiedinattributesofnestedelements.AttributenamesarethesameasCSVcolumnnames.
Name Meaning
name Connectionname
Managingconnections
Providepredefinedconnections
ImportingconnectionsfromCSV/XML
Supportednames:
url JDBCURL
host Databaseserverhostname
port Databaseserverport
database Database/schemaname
user Username
password Userpassword
YoucanspecifyjustURLorsethost/port/etcsetting.Username/passwordareoptions.
name,host,port,server,database,url,user,password,typePostgreImportXML1,localhost,5432,,postgres,jdbc:postgresql://localhost:5432/postgres,postgres,postgres,devPostgreImportXML2,localhost,5432,,postgres2,jdbc:postgresql://localhost:5432/postgres2,postgres2,postgres2,prod
<connections><connectionname="PostgreImportXML1"host="localhost"port="5432"server=""database="postgres"url="jdbc:postgresql://localhost:5432/postgres"user="postgres"password="postgres"type="dev"/><connectionname="PostgreImportXML2"host="localhost"port="5432"server=""database="postgres"url="jdbc:postgresql://localhost:5432/postgres2"user="postgres2"password="postgres2"type="prod"/></connections>
SampleCSV
SampleXML
Secureconnectionsfromediting
Itispossibletomakeconnectionsettingsread-only(protectedbypassword)
GenerateMD5hashofyourpassword.YoucandoitfromcommandlineusingLinuxutilitymd5sum( md5sum<<<"yourpassword" )oryoucandoitonline-justgoogle"MD5hashonline".
Addattribute lockPassword inconnectiondescriptor(in.dbeaver-data-sources.xml filein <dataSource> tag.Soitwilllooklikethis:
<data-sourceid="postgresql-1294077257514--1782558860"provider="postgresql"driver="postgres-jdbc"name="Postgre-sample"create-date="1294077257524"update-date="1468749632751"login-date="1469021247956"save-password="true"show-system-objects="true"read-only="false"lockPassword="2ba81a47c5512d9e23c435c1f29373cb">
Nowifuserwilltrytochangeconnectionsettingshe/shewillbeaskedforpassword
Youcancustomizedriversconfigurationin${HOME}/.dbeaver4/.metadata/.plugins/org.jkiss.dbeaver.core/drivers.xml
file.Ifyouhavesomepre-installedjarfilesyoucanreferencethemindrivers.xml.Example:
<librarytype="jar"path="absolute-jar-folder-path\driver-jar.jar"custom="true"/>
Alsoindrivers.xmlyoucanusefollowingvariablestospecifyrelativepaths:
Variable Meaning
drivers_home StandardDBeaverdriverslocation( ${HOME}/.dbeaver-drivers bydefault)
dbeaver_home DBeaverinstallationfolder
home Userhomefolder
workspace DBeaverworkspacepath( ${HOME}/.dbeaver4 bydefault)
Forinstance:
<librarytype="jar"path="${dbeaver_home}\drivers\my-driver.jar"custom="true"/>
ManagingdriversConfiguredriverswithpre-installedjars
DBeaverisanEclipseRCP(https://wiki.eclipse.org/Rich_Client_Platform)application.ItconsistsfromasetofEclipseplugins,featuresandproducts.
docs -somedocumentations(mostlyoutdated)
features -featuredescriptors.Doesn'tcontainanysourcecode.Usedtostructurizeproductplugins/dependencies.
bundles -verybaseplugins(likeutils)
plugins -mainsourceslocation
org.jkiss.dbeaver.model -modelAPIandbaseclasses.Doesn'tcontainanyUIdependencies,justpuredatamodel.
org.jkiss.dbeaver.core -mainDBeavermodule.MostofbaseUIclassesarehere.
org.jkiss.dbeaver.core.application -relativelysmallmodulewhichconfiguresstandaloneDBeaverapplication.
org.jkiss.dbeaver.core.eclipse -mainEclipseplugin.Addssomeextramenus/viewstostandardEclipseIDE.
org.jkiss.dbeaver.ext.* -DBeaverextensions
product -finalproducts(standaloneandEclipseplugin)configuration.
DevelopinEclipse
Sourcesstructure:
OpeningworkspaceinEclipse
Youwillneedtosetup"EclipseforRCPandRAPdevelopers(https://www.eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/oxygen1a)".CurrentlydefaultEclipseversionisOxygen(4.7).Buildmayfailonnewerorolderversions.ThenyouwillneedtoinstallafewadditionalEclipsepluginswhichDBeaverdependson(andwhicharenotincludedinthestandardEclipsedistribution):
OpenmainmenuHelp->InstallNewSoftware
Copy http://dbeaver.jkiss.org/eclipse-repo/ into"Workwith"fieldandpressenterimages/eclipse-deps-install.png
Checkallpluginsandfinishtheinstallationprocess
NowyouneedtocheckoutDBeaverrepositorywith gitclonehttps://github.com/serge-rider/dbeaver.git command.InEclipsecreateanewworkspaceandrunImportwizard.Choose"General->ExistingprojectsintoWorkspace".SelectDBeavercheckoutdirectoryasrootadirectory.CheckallpluginsandfeaturesEclipsewillfindandfinishthewizard.
NowyoucanbuildDBeaver( Ctrl+B ).Torunthestandaloneversionfindfile DBeaver.product (itislocatedin product/standalonedirectory).Openitandclickon"LaunchanEclipseapplication"or"LaunchanEclipseapplicationinDebugmode".
Ifproductwon'tstartwith Noapplicationidhasbeenfound errortrythisworkaround:https://stackoverflow.com/questions/13575695/eclipse-rcp-no-application-id-has-been-found(https://stackoverflow.com/questions/13575695/eclipse-rcp-no-application-id-has-been-found)
WhatyouneedtodoisgotoyourRunConfigurations(Run->RunConfigurations).SelectthePlug-instabandthenhit"AddRequiredPlug-ins".Apply,thenRun,anditshouldworknow.
That'sit.
EverythingabovecoversCommunityEditionversion.
Notes:
TheDBeaverfeaturesarestructuredtosupportboth"IDE"and"RCA"mode
(https://github.com/serge-rider/dbeaver/wiki/images/development/DBeaver-CE-Features.png)/images/development/DBeaver-CE-Features.png
FeaturesstructureFeaturesStructure
Sometimes(especiallyaftermultipleDBeaverversionsupgrade)workspacebecomemessy.Somekeyboardshortcutsmaystopworking,toolbarslayoutmaybebroken,etc,etc.ToresetallUIsettings(thisincludesmenus,shortcuts,viewandtoolbarlayouts):
1. ShutdownDBeaver
2. Gotodirectoryto%HOMEPATH%\.dbeaver\.metadata\.plugins\org.eclipse.e4.workbench\
Windows: Win+R ,enter%HOMEPATH%\.dbeaver\.metadata\.plugins\org.eclipse.e4.workbench\
Linux: cd$HOME/.dbeaver/.metadata/.plugins/org.eclipse.e4.workbench/
3. Deletefile workbench.xmi
4. StartDBeaver
Ifthatdoesn'thelpthenyoucantrytoremove%HOMEPATH%\.dbeaver\.metadata\ folder.ThiswilleraseallyourUIsettingsandSQLscriptsconfigurations(butallconnectionsandscriptswillremain).Doitonlyifnothingelsehelps!
That'sit.
Resetworkspace
Afewtips.
Checkexistingissuesforyourissue(includingclosedones).Duplicatinganissueisslowerforbothpartiessosearchthroughopenandclosedissuestoseeifwhatyou’rerunningintohasbeenaddressedalready.
Beclearaboutwhatyourproblemis:whatwastheexpectedoutcome,whathappenedinstead?Detailhowsomeoneelsecanrecreatetheproblem.
Ifyoupostingabugreportcheck"ErrorLog"view.Ifthereareanyerrorsrelatedtoyourbugthenpostacompletestacktrace.SometimestherearenoerrorsinErrorLog-thentrytofindtheminlogfiles.
Ifyourissueisrelatedtoadatabasedataormetadatamanagement-checktheQueryManagerview.ItcontainsinformationaboutallqueriesDBeaverexecutes(explicitlyorimplicitly).ToseemoredetailedinformationyoucanconfigureQueryManagerinPreferences.images/qm-view.png
Dependingonthenatureofyourbugreportprovideinformationabout:
Operatingsystem
Windowmanager(forLinux)
Database(nameandversion)
Databasedriver(nameandversion)
Postingissues
Donotwriteissuetypeintheissuetitle(likeFeatureRequest:,Bug:etc).We'llreviewyourissueandassignacorrespondinglabel.
DBeaverwritesdifferentlogfiles.MostofthemareEclipselogs.Usuallylogfilesresidesintheworkspace.Defaultworkspacelocationis ${HOME}/.dbeaver ( ${HOME}/.dbeaver4forDBeaver4.x+).
Twostandardlogfiles:
<workspace-path>/.metadata/.log -allwarningsanderrorswhichhappensduringnormalwork
<workspace-path>/.metadata/dbeaver-debug.log -thesameas .logplusdebuginformation
Inspecialcaseslogfilescanwritteninotherdirectories.SpecialcaseisanemergencysituationwhenDBeavercan'tstartandthereisnoworkspace.Twotypicalplacestofindemergencylogs:
<install-path>/configuration
${HOME}/.eclipse/org.jkiss.dbeaver.product_<dbeaver-version>
Ifyouarereportingaboutsomeerrorpleaseattachlogs(notcompletefilebutvaluablepartofit).Logsareveryuseful,bignumberoferrorscan'tbereproduced/fixedwithoutfullerrorstacktrace.
Logfiles
Sometimes(duetosomebug)DBeaverUIhangs,freezesorworksincorrectly.Usuallyitisimpossibletofindthereasonofsuchproblemwithoutthreaddump.ThreaddumpistheinformationaboutinternalexecutionstateofJavaprogram.Togetthreaddump:
Runthefollowingonyourterminal:
jstack$(psaux|grep-m1dbeaver|awk'{print$2}')>thread-dump.txt
Justopentaskmanager(CTRL+Escape),findDBeaverintheprocesslistandcopyprocessIDvalue.OnWindows8+youneedtoswitchto"Details"tab.Run
jstack<PID>>thead-dump.txt
inCommandPrompt.
Nowyoucanattachthread-dump.txttotheGitHubissue.
Threaddump
MacandLinux
Windows