diff --git a/commands/sql/sql.drush.inc b/commands/sql/sql.drush.inc
index b1a4509..103874a 100644
--- a/commands/sql/sql.drush.inc
+++ b/commands/sql/sql.drush.inc
@@ -226,6 +226,16 @@ function _drush_sql_connect($db_spec = NULL) {
     case 'sqlsrv':
       $command = 'sqlcmd';
       break;
+    case 'oracle':
+      // use rlwrap if available for readline support
+      if ($handle = popen('rlwrap -v', 'r')) {
+        $command = 'rlwrap sqlplus';
+        pclose($handle);
+      }
+      else {
+        $command = 'sqlplus';
+      }
+      break;
   }
   $command .= _drush_sql_get_credentials($db_spec);
   return $command;
@@ -418,6 +428,20 @@ function drush_sql_build_dump_command($table_selection, $db_spec = NULL, $file =
     case 'sqlsrv':
       $exec = "echo 'sqlsrv sql-dump not yet supported'";
       break;
+    case 'oracle':
+      $create_db = drush_get_option('create-db');
+      $exec = 'exp '._drush_sql_get_credentials($db_spec);
+      if ($file)
+        $exec .= ' file='. $file;
+      else
+        $exec .= ' file='.$db_spec['username'].'.dmp';
+     
+      if (!empty($tables)) 
+        $exec .= ' tables="('.implode(',',$tables).')"';
+      else
+        $exec .= ' owner='.$db_spec['username'];
+       
+      break;
   }
 
   if (drush_get_option('gzip')) {
@@ -513,6 +537,11 @@ function _drush_sql_query($query, $db_spec = NULL, $filename = NULL) {
     }
   }
 
+  // is this an oracle query
+  if ($scheme == 'oracle') {
+    $query = drush_sql_format_oracle($query);
+  }
+
   // Convert mysql 'show tables;' query into something pgsql understands
   if (($scheme == 'pgsql') && ($query == 'show tables;')) {
     $query = drush_sql_show_tables_pgsql();
@@ -562,6 +591,9 @@ function _drush_sql_drop($db_spec = NULL) {
     case 'sqlsrv':
       $query = 'SELECT TABLE_NAME FROM information_schema.tables';
       break;
+    case 'oracle':
+      $query = "SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME NOT IN ('BLOBS','LONG_IDENTIFIERS')";
+      break;
     default:
       $query = 'SHOW TABLES;';
   }
@@ -880,6 +912,13 @@ function _drush_sql_get_credentials($db_spec = NULL) {
       $host = empty($db_spec['server']) ? '.\SQLEXPRESS' : $db_spec['server'];
       return ' -S ' . $host . ' -d ' . $database . ' -U ' . $db_spec['username'] . ' -P ' . $db_spec['password'];
       break;
+
+
+    case 'oracle':
+      // Return an Oracle connection string
+      return ' ' . $db_spec['username'].'/'.$db_spec['password'].($db_spec['host']=='USETNS' ? '@'.$db_spec['database'] : '@//'.$db_spec['host'].':'.($db_spec['port']?$db_spec['port']:'1521').'/'.$db_spec['database']);
+      break;
+
   }
 
   // Turn each parameter into a valid parameter string.
@@ -965,6 +1004,38 @@ function drush_sql_show_tables_pgsql() {
   return "select tablename from pg_tables where schemaname='public';";
 }
 
+// Format queries to work with Oracle and SqlPlus
+function drush_sql_format_oracle($query) {
+
+  // remove trailing semicolon from query if we have it
+  $query = preg_replace('/\;$/', '', $query);
+
+  // some sqlplus settings
+  $settings[] = "set TRIM ON";
+  $settings[] = "set FEEDBACK OFF";
+  $settings[] = "set UNDERLINE OFF";
+  $settings[] = "set PAGES 0";
+  $settings[] = "set PAGESIZE 50000";
+  
+  // are we doing a describe ?
+  if (!preg_match('/^ *desc/i', $query)) {
+    $settings[] = "set LINESIZE 32767";
+  }
+
+  // are we doing a show tables ?
+  if (preg_match('/^ *show tables/i', $query)) {
+    $settings[] = "set HEADING OFF";
+    $query = "select object_name from user_objects where object_type='TABLE' order by object_name asc";
+  }
+
+  // create settings string
+  $sqlp_settings = implode("\n", $settings)."\n";
+
+  // important for sqlplus to exit correctly
+  return "${sqlp_settings}${query};\nexit;\n";
+}
+
+
 /*
  * Drop all tables (if DB exists) or CREATE target database.
  *
@@ -1109,6 +1180,18 @@ function drush_sql_build_exec($db_spec, $filepath) {
       $exec .= _drush_sql_get_credentials($db_spec);
       $exec .= ' -h -1 -i "' . $filepath . '"';
       break;
+    case 'oracle':
+      if (!preg_match('/\.sql$/i',$filepath))
+      {
+          rename($filepath, $filepath.'.sql');
+          $filepath .= '.sql';
+      }
+
+      $exec = 'sqlplus';
+      $exec .= ' ' . drush_get_option('extra');
+      $exec .= _drush_sql_get_credentials($db_spec);
+      $exec .= " @$filepath";
+      break;
   }
   return $exec;
 }
diff --git a/includes/dbtng.inc b/includes/dbtng.inc
index 1546987..88d9584 100644
--- a/includes/dbtng.inc
+++ b/includes/dbtng.inc
@@ -106,11 +106,15 @@ function drush_db_select($table, $fields = '*', $where = NULL, $args = NULL, $st
       $query .= " ORDER BY $order_by_field $order_by_direction";
     }
     if (!is_null($length)) {
-      $limit = " LIMIT $length";
-      if (!is_null($start)) {
-        $limit .= " OFFSET $start";
+      if ($db_scheme == 'oracle')
+           return db_query_range($query, $start, $length);
+      else {
+	      $limit = " LIMIT $length";
+	      if (!is_null($start)) {
+		$limit .= " OFFSET $start";
+	      }
+	      $query .= $limit;
       }
-      $query .= $limit;
     }
 
     return db_query($query, $args);
@@ -180,4 +184,4 @@ function drush_db_fetch_object($result) {
 
 /**
  * @} End of "defgroup dbfunctions".
- */
\ No newline at end of file
+ */
diff --git a/includes/environment.inc b/includes/environment.inc
index 5a9628a..dc4cb13 100644
--- a/includes/environment.inc
+++ b/includes/environment.inc
@@ -398,6 +398,9 @@ function drush_valid_db_credentials() {
     return FALSE;
   }
   $type = $creds['driver'];
+
+  $type = ( $type=='oracle' ? 'oci' : $type);
+
   switch (drush_drupal_major_version()) {
     case 6:
       // Check availability of db extension in PHP and also Drupal support.
@@ -483,6 +486,17 @@ function drush_valid_db_credentials() {
         }
         $constr = sprintf("%s:database=%s;server=%s", $type, $creds['name'], $server);
       }
+      elseif ($type === 'oci') {
+
+        if (empty($creds['port']))
+          $creds['port'] = 1521;
+
+        if ($creds['host'] == 'USETNS')
+          $constr = 'oci:dbname='.$creds['database'] .';charset=AL32UTF8';
+        else  
+          $constr = 'oci:dbname=//'.$creds['host'].':'.$creds['port'].'/' . $creds['database'].';charset=AL32UTF8';
+
+      }
       else {
         $constr = sprintf("%s:dbname=%s", $type, $creds['name']);
         // Use unix_socket if set instead of host:port.
