Skip to content

Tadpole DB HUB(MongoDB) User Guide

suhyunjeon edited this page Sep 4, 2013 · 4 revisions

Tadpole DB HUB(MongoDB) User Guide

Welcome to Tadpole! This is a web-based DB Query tool. You can connect variety DB in web browser and can control function for each users(user or admin or dba and so on). The goal is a DB HUB for all DB.

Homepage : https://github.com/hangum/TadpoleForDBTools/wiki License : Lesser General Public License(LGPL) Donate with paypal it’s easy to give with PayPal for Tadpole. Detail see - https://github.com/hangum/TadpoleForDBTools/wiki/Donor-List Contact : TADPOLE([email protected]) Now we are supporting - Amazon RDS, CUBRID, MarisDB, Oracle, MySQL, MSSQL, PostgreSQL, SQLite, MongoDB. Tadpole lets you creatively focus on your project by simply the amount of work needed for a given task.

List of tested

  • Amazon RDS : aws-java-sdk-1.4.7
  • CUBRID : 8.4.x ~
  • Oracle : 10g ~
  • MySQL : 5.4.x ~
  • MariaDB : 5.5.x ~
  • MSSQL : 2000 ~
  • PostgreSQL : 9.1.x ~
  • SQLite : 3.7.2 ~
  • MongoDB : 2.0.5 ~

Documentation

This is explain for MongoDB.

Agenda

Install

  1. JAVA 1.6.x(Mac 1.7.x)
  2. Linux, Mac, Windows, Tomcat 6.x (If you want to user the other O.S, connect me : [email protected])
  3. Download 받아서 적당한 디렉토리에 압축을 풉니다.
  4. Reference more

Getting Started

Standalone installation

  1. Execute TadpoleDBHub-1.x.x\tadpole-standalone.exe
  2. After install, automatically run a web-browser(OR you can install the TadpoleForDBToolsStartup by double click). It will happen to you when you first start that you can't find the page to the web-browser cause engine is starting. Don't freak out. Let's click F5(Refresh).
  3. Open the web-browser and start 'http://127.0.0.1:10081/tadpole'

ps) Tadpole DB is TadpoleDBHub-1.x.x/configuration/tadpole/db/tadpole-system.db. Please install new version and backup.

Install Tomcat

  1. Did you have installed Tadpole before? OK. Please backup a apache-tomcat-6.x.x/work/Catalina/localhost/tadpole/eclipse/configuration/tadpole/db/tadpole-system.db file. And delete apache-tomcat-6.x.x/work directory.
  2. Change war name to 'tadpole.war' from 'TadpoleDBHub1.x.x-tadpole.war'.
  3. The WAR file should be in the webapp directory path. And Tomcat should be installed and running.
  4. If the context root is tadpole, start http://127.0.0.1:8080/tadpole/tadpole in the web-browser.
  5. If you upgrade to datas of old data, copy to tadpole-system.db from a backup file(number1. apache-tomcat-6.x.x/work/Catalina/localhost/tadpole/eclipse/configuration/tadpole/db/tadpole-system.db) in same directory.

Login

Login

  1. Test mode window.
  2. Tadpole has Admin, Manager, User(Developer). First DEFAULT USER made.
  1. If you want to try test mode, you don't need to EMAIL ADDRESS, PASSWORD. We supported 'admin login/user login' for test mode. Do you want use to test mode? Click the button.
  2. Add new user : (https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EC%8B%A0%EA%B7%9C-%EC%9C%A0%EC%A0%80-%EB%93%B1%EB%A1%9D)

권한

  1. 어드민은 시스템에 등록된 모든 디비(패스워드 제외)와 사용자를 관리 합니다.
  2. 관리자는 사용자 그룹을 관리 합니다. 사용자들과 DB, 리소스등을 공유하며 함께 사용 합니다. 처음 관리자를 만드실때는 프로젝트 그룹 처음등록시 어드민의 허락이 필요합니다. DB를 등록 삭제 할 수 있습니다. 사용자는 디비를 등록 할 수 없습니다.
  3. DBA는 사용자 리스트와 디비를 볼 수 있으며, 사용자가 실행한 쿼리를 관리할 수 있습니다.
  4. 사용자는 실제 사용자 입니다. 사용자는 특정 그룹에 소속 되어야 하며 관리자의 승인 후 로그인 가능합니다. 관리자가 등록해 놓은 디비를 사용할 수 있으며, 쿼리등을 다른 사용자와 공유할 수 있습니다.

The whole view of Tadpole

Tadpole part

  1. Toolbar(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%ED%88%B4%EB%B0%94) : Connection DB, save, authority(if it is a 'manager' or an 'admin' user), environment and so on.
  2. Database List(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EB%AA%A9%EB%A1%9D) : New create DB, delete, shared user's data.
  3. Object Explorer(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#%EC%98%A4%EB%B8%8C%EC%A0%9D%ED%8A%B8-%ED%83%90%EC%83%89%EA%B8%B0) : Show the Object(Table, View)' list of select to the Database List.
  4. Main UI(https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Kor#sql-editor) : Show the DB Query editor, MongoDB profile viewer and main job viewer.

Toolbar

A toolbar is a GUI widget on which on-screen buttons, icons, menus, or other input or output elements are placed. And limited permission. 'Manager' can use all function, 'User' can't create DB, delete, profile functions.

toolbar

  • Show connection DB window.
  • Save data in current SQL Editor.
  • Show SQL Editor selected 'Database List' window.
  • Show ERD Editor selected 'Database List' window.
  • Delete shared resources selected 'Database List' window.
  • Show user, db information.
  • Show query statements history information all DB.
  • Show environment information.
  • Show bug, request issues.(need to Github account)
  • Show system preferences.
  • Close button.(If standalone, program shutdown, or run Tomcat, logout)

Database List

Display DB list which do allow the connections. Managing DB. Use shared connection information to user in same groups.

Add DB and Use

Only Manager permission user can add DB.

Add DB : Toolbar connection-toolbar-btn click.

connection dialog

  1. DB List for connection
  2. System preference to management Tadpole
  • Server type : Input DB of server type
  • Server type -> Production Server : Create management DB. If the database is active, 'user' can't delete Collection.
  • Server type -> Developer Server : This is development DB and you can do all thing for except permission.
  • Server type -> Others Server : This is add other uses of a DB and you can do all thing for except permission.
  • Group : DB group to add each other easier.
  • Name : DB name for Database List.
  1. Input database information selected no.1.
  2. Additional information connected no.2.
  • Readonly Connection : Can't remove, Modify and so on connected DB. Only SELECT statements is possible in SQL Editor.
  • Auto Commit : When the auto-commit mode is enabled, the operation commits the transaction immediately after an INSERT, UPDATE or DELETE operation. When auto-commit is disabled, the transaction must be committed (through the effective SQL session) as required.
  • Table Filters : The filter is hidden and shown in the 'Object Explore'.
  • Profile : Query description, query execution time, monitor, result, and measure your application's SQL statements and stored procedures.
  • Show Tables : Display all of the tables in 'Object Explore'. When single schema has large tables, hide table and it prevent much slow for current status.
  1. Test, Save, Cancel to saved DB.
  • Test Connection : Display the information, when it is possible for a connection to input information of no.2.
  • Confirm : Add input DB connection information.
  • Cancel : Cancel add DB and close job..

Conneccted DB

If you add DB in the 'Database List', display in the group. And open SQL Editor of DB.

connection-2

  1. DB는 'DB아이콘 [D] 등록이름 (개정정보)' 표시 됩니다. DB name tag
  • 첫 번째는 DB의 종류입니다.
  • [D]는 Developer Server의 약어입니다. Production Server는 [P]로 표시되면 Others Server는 [O]로 표시됩니다.
  • 등록했던 이름 입니다.
  • 등록했던 DB의 계정 정보입니다. (사용자 권한의 유저는 보이지 않습니다)
  1. DB를 선택하면, '오브젝트 탐색기'에 Object(예를 들어. 선택된 DB의 Collections, Indexes, JavaScript)가 표시됩니다.
  2. DB를 더블 클릭하면 DB의 인스턴스 정보, Collection 요약, 디비 락, 리플리카 셋, 샤딩 정보 창이 열립니다.
  3. DB를 선택 후 마우스 오른쪽 버튼을 클릭하면 사용자 권한의 엑션이 표시 됩니다.
  • Refresh : '데이터베이스 목록'창을 최신 정보로 갱신합니다.
  • 웹 콘솔 : MongoDB WebConsole 창이 열립니다.
  • Server Status : DB 프로세스 사용정보 다이얼로그가 보여 집니다.
  • GridFS : GridFS 명령의 결과 다이얼로그가 보여집니다.
  • Top : DB 사용 정보 다이얼로그 오픈됩니다.
  • ERD -> 모든 테이블 ERD : DB의 모든 테이블의 관계를 보여줍니다.
  • ERD -> ERD 기본창 생성 : ERD을 그릴 수 있는 창이 생성 됩니다. 사용자는 '오브젝트 탐색기'에서 테이블들을 가져다 놓을수 있습니다.
  • Administer -> 프로파일 : DB에서 실행 했던 쿼리 정보를 보여줍니다.
  • Administer -> 사용자 관리 : DB 사용자 관리 다이얼로그가 오픈됩니다.
  • Administer -> DB Information : '오브젝트 탐색기'에 Object(예를 들어. 선택된 DB의 Collections, Indexes, JavaScript)가 표시됩니다.
  • Administer -> Session List : DB에서 현재 실행 중인 Session 목록을 보여줍니다.
  • Administer -> 임포트 : 올챙이에 연결된 DB의 데이터를 MongoDB로 데이터를 가져옵니다.
  • Administer -> Delete Database : DB를 삭제합니다. 모든 사용자의 DB가 삭제되니 신중하게 선택해야 합니다.

오브젝트 탐색기

'데이터베이스 목록'에서 DB가 선택되면, Collections, Indexes, JavaScript가 표시됩니다.

mongo object

Filter : Collection을 검색합니다

  1. Collection이 선택되면 Collection의 field정보가 표시됩니다.
  2. Collection을 더블클릭하면 Collection 조회 창이 나타납니다.
  3. Collection을 선택하고 마우스 오른쪽 버튼을 누르면 팝업 메뉴가 나타납니다.
  • Create Collection : Collection을 생성합니다.
  • Drop Collection : Collection을 삭제합니다.
  • Refresh Collection : 현재 창을 최신 정보로 갱신 합니다.
  • Generate Statement : Collection : Collection에 새로운 row를 추가합니다.
  • Rename Collection : Collection 이름을 수정합니다.
  • ReIndex Collection : Connection의 인덱스를 새롭게 구성합니다. Collection에 데이터가 많은 경우 주의가 필요합니다.

Database Information Editor

연결된 몽고디비의 모든 Collection 정보를 보여 줍니다. 이 화면은 Connectection Manager에서 디비를 더블클릭하여 볼 수 있습니다.

mongodb all connection

  • Name Filter : Collection 이름을 기준으로 필터링 합니다.
  • Collection을 선택하면 해당 Collection의 field정보가 출력됩니다.
  • Collection을 더블 클릭하면 해당 Collection을 검색하는 창으로 이동합니다.
  • 하단에는 DB의 summary정보가 출력됩니다.

Find Collection

Collection 정보를 검색합니다. 기본적으로 JSON 으로 검색 할 수 있는 창이 존재합니다. 기본적인 검색 결과를 Tree, Table형태로 보여줍니다. 에디터에서 Ctrl + Space를 누르면 Field정보가 표시 됩니다.

mongodb find collection

  1. Collection 검색 창
  • 조건은 다음과 같이 입력합니다. op field 가 query인 항목을 검색한다고 하면 다음과 같습니다. {op : 'query'}
  • Find : 검색 정보를 입력 합니다 예를 들어 위의 캡쳐화면에서는 item_id가 7인 정보를 검색하는 예제입니다.
  • Field : 위의 캡쳐화면에서 검색 결과 필드를 quantity를 보여줍니다. 만약에 모든 Field를 보여주려면 입력하지 않습니다.
  • Sort : 위의 캡쳐화면에서 필드 quantity를 내림차순으로 검색합니다.
  • Skip : 검색 결과 중에 Skip합니다.
  • Limit : 검색 결과 중의 조건을 100건 만 표시합니다.
  1. 쿼리 플랜 : 검색 조건의 query explain 정보를 다이얼로그 화면을 오픈합니다.
  • 서버 메시지 : 검색 중에 서버에서 발생한 메시지 다이얼로그 화면을 오픈합니다.
  • 검색 : 검색을 시작합니다.
  1. 검색 결과를 출력합니다.
  • Tree View : 검색 결과를 Tree 형태로 출력합니다. Value클릭하여 값을 수정 할수 있습니다. 결과를 더블클릭하면 JSON형식으로 표시됩니다.
  • Table View : 검색 결과를 Table 형태로 출력합니다. 결과를 더블클릭하면 TREE형식으로 표시됩니다.
  • Tadpole Message : 검색 실패시 정보를 출력합니다.
  1. 검색 결과에 따른 명령을 수행합니다.

GridFS 기능

GridFS은 몽고디비에서 파일을 올리거나 내릴 수 있습니다.

mongodb  gridfs

  1. bucket : 검색 할 bucket 이름
  2. File Name : 검색 할 파일 이름
  3. Skip : 검색 결과 skip 수
  4. Limit : 검색 결과 Limit 수
  5. Search Button : 검색 결과
  6. Insert Button : 입력 다이얼로그
  7. Delete Button : file 선택 후 삭제 버튼
  8. Download Button : file download

Insert 버튼을 클릭하면 다음과 같은 화면이 오픈 됩니다.

gridfa insert

  1. Bucket Name : 저장 할 bucket 이름을 입력합니다.
  2. Select File 버튼 : 업로드 할 파일을 선택합니다.
  3. Upload 버튼 : Select File에서 선택한 파일을 업로드 합니다.
  4. OK 버튼 : 저장 합니다.

Profiling

몽고디비는 실행한 질의를 프로파일 하는 기능이 있습니다.

profiling

  1. Start Profiling 버튼 : 몽고디비의 프로파일을 한번도 수행하지 않았다면 클릭하여 쿼리의 프로파일을 시작합니다.
  2. Stop Profiling 버튼 : 몽고디비의 프로파일을 중지합니다.
  3. Remove Profile Data 버튼 : 프로파일 데이터를 삭제합니다.
  4. Display 텍스트 : 화면 갱신 주기
  5. Great then(millis) 텍스트 : 쿼리 수행 속도
  6. Limit 텍스트 : 쿼리 검색 결과 한도
  7. Start Refresh : Great then, limit 조건으로 검색을 시작합니다.
  8. Stop Refresh : 검색을 중지합니다.

Query가 있는 검색 조건의 경우 쿼리를 튜닝 할 수 있습니다. 튜닝이 필요한 행을 더블 클릭하거나, Show Detail 버튼을 클릭하면 튜닝 화면이 오픈 됩니다.

query tuning

ERD

몽고디비의 컬랙션 정보를 읽어서 다이어그램 형태로 보여집니다. Connection Manager에서 All Table ERD를 클릭하면, 디비의 모든 Collection 를 diagram으로 표현 합니다. Create ERD Diagram을 클릭하면 Object Explorer에서 사용자가 원하는 Collection만 출력 할 수 있습니다.

mongodb erd

Import

올챙이에 연결된 디비의 데이터를 몽고디비로 Import하는 기능입니다. 테이블의 전체 혹은 쿼리를 입력하여 몽고디비에 데이터를 import합니다.

테이블 데이터는 가져올 때는 RDB의 테이블 명을 몽고디비 에서는 Collection 명으로 가져옵니다.

import-table

쿼리 정보를 이용하여 데이터를 임포트 합니다

import-query

Session List

  • MariaDB, MySQL은 Session List를 볼 수 있습니다.

session-list

Session List는 DB에서 실행 중인 Session 목록이 표시됩니다. 장시간 실행 중인 쿼리나 비정상적인 쿼리를 종료 할수 있습니다.

  1. Session List에서 실행할 수 있는 기능을 모아 놓았습니다.
  2. 현재실행 중인 쿼리 목록을 표시합니다.
  3. ②번의 쿼리를 선택하면, 어떤 쿼리가 실행 중인지 실제 SQL 문이 표시됩니다.

User Management

그룹에 사용자 리스트와, DB 리스트를 관리하며 사용자를 추가하거나, 사용중지 상태로 변경 할 수 있습니다. 혹은, 사용자가 실행 했던 쿼리목록을 조회할 수 있으며 이 기능은 관리자와 DBA만 사용 할 수 있습니다.

UserManagement

전체 사용자 리스트가 표시되며 사용자를 더블클릭하면 'Executed SQL Management' 화면이 표시됩니다. 이 화면은 사용자가 실행했던 쿼리를 다시 실행할 수 있습니다.