Giter Club home page Giter Club logo

dmdump's Introduction

Database Dump

This project is designed to use SQLcl to dump the database objects for the connected SCHEMA to the filesystem.

dmdump requires the SQLcl bin directory to be in your PATH.

Prerequisites

  • Download and unzip SQLcl.
  • Add the SQLcl bin directory to your PATH.

Install

  • Clone or download dmdump onto your system.

Unix

  • Create a symbolic link to the script dmdump.sh:
sudo ln -s /opt/dmdump/dmdump.sh /usr/bin/dmdump

Windows

  • Add dmdump to your PATH:
SET PATH=%PATH%;C:\dmdump\

Usage

  • Navigate to the desired output directory.
  • Run dmdump as follows:
dmdump {connect_string}

Arguments

Name Description Example
connect_string The connect string to connect to a database using sqlcl on the command line.
Note: A password is required at this stage.
- hr/hr@//server:port/service_name
- hr/hr@//server:port:sid
- hr/hr@XE1

Sample Output

.
├── function
│   └── GET_NAMES.sql
├── index
│   ├── COUNTRY_C_ID_PK.sql
│   ├── DEPT_ID_PK.sql
│   ├── DEPT_LOCATION_IX.sql
│   ├── EMP_DEPARTMENT_IX.sql
│   ├── EMP_EMAIL_UK.sql
│   ├── EMP_EMP_ID_PK.sql
│   ├── EMP_JOB_IX.sql
│   ├── EMP_MANAGER_IX.sql
│   ├── EMP_NAME_IX.sql
│   ├── JHIST_DEPARTMENT_IX.sql
│   ├── JHIST_EMP_ID_ST_DATE_PK.sql
│   ├── JHIST_EMPLOYEE_IX.sql
│   ├── JHIST_JOB_IX.sql
│   ├── JOB_ID_PK.sql
│   ├── LOC_CITY_IX.sql
│   ├── LOC_COUNTRY_IX.sql
│   ├── LOC_ID_PK.sql
│   ├── LOC_STATE_PROVINCE_IX.sql
│   └── REG_ID_PK.sql
├── package
│   ├── FOO.pkb
│   └── FOO.pks
├── procedure
│   ├── ADD_JOB_HISTORY.sql
│   ├── NAMED_NOTATION_DEMO.sql
│   └── SECURE_DML.sql
├── sequence
│   ├── DEPARTMENTS_SEQ.sql
│   ├── EMPLOYEES_SEQ.sql
│   └── LOCATIONS_SEQ.sql
├── table
│   ├── COUNTRIES.sql
│   ├── DEPARTMENTS.sql
│   ├── EMPLOYEES.sql
│   ├── JOB_HISTORY.sql
│   ├── JOBS.sql
│   ├── LOCATIONS.sql
│   └── REGIONS.sql
├── trigger
│   ├── SECURE_EMPLOYEES.sql
│   └── UPDATE_JOB_HISTORY.sql
├── type
│   └── CL_VARCHAR2_TABLE.sql
└── view
    ├── EMP_DETAILS_VIEW.sql
    └── V_MY_VIEW.sql

dmdump's People

Contributors

tschf avatar zhudock avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

zhudock

dmdump's Issues

Packages ddl gets space added to the opening line

SQL> CREATE OR REPLACE PACKAGE "HR"."FOO2"
  2  as
  3      bar NUMBER := 1;
  4  end foo2;
  5  /

Package FOO2 compiled

SQL> spool output.sql
SQL> ddl foo2
  CREATE OR REPLACE PACKAGE "HR"."FOO2" 
as
    bar NUMBER := 1;
end foo2;
/
SQL> spool off
SQL> exit

Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

image

Add Windows support

I was able to get Windows support working in my fork. If there's any interest I'll submit a PR.

`create or replace package` capitalised

Eg1

SQL> create or replace package foo2
  2  as
  3      bar NUMBER := 1;
  4  end foo2;
  5  /

Package FOO2 compiled

SQL> ddl foo2
  CREATE OR REPLACE PACKAGE "HR"."FOO2" 
as
    bar NUMBER := 1;
end foo2;
/
SQL> 

image

I note the create or replace bit doesn't exist in the user_source view, so maybe this is expected..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.