diff --git a/commands/sql/sql.drush.inc b/commands/sql/sql.drush.inc
index af209e1..bfd5bea 100644
--- a/commands/sql/sql.drush.inc
+++ b/commands/sql/sql.drush.inc
@@ -944,8 +944,12 @@ function _drush_sql_get_credentials($db_spec = NULL) {
 
 
     case 'oracle':
+
+      if ($db_spec['database'])
       // 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']);
+      else
+      return ' / as sysdba';
       break;
 
   }
@@ -1142,6 +1146,14 @@ function drush_sql_build_createdb_sql($db_spec, $quoted = FALSE) {
       $sql[] = sprintf('drop database if exists %s;', $dbname);
       $sql[] = sprintf("create database %s ENCODING 'UTF8';", $dbname);
       break;
+    case 'oracle':
+      $dbname = $db_spec['username'];
+      $sql[] = sprintf("begin execute immediate 'drop user %s cascade'; exception when others then null; end;\n/", $dbname);
+      $sql[] = sprintf("begin execute immediate 'drop tablespace %s including contents and datafiles;'; exception when others then null; end;\n/", $dbname);
+      $sql[] = sprintf("create tablespace %s datafile size 100M autoextend on maxsize 1G;", $dbname);
+      $sql[] = sprintf("create user %s identified by %s default tablespace %s quota unlimited on %s;", $dbname, $db_spec['password'], $dbname, $dbname);
+      $sql[] = sprintf("grant connect, resource to %s;", $dbname, $dbname);
+      return implode("\n", $sql);
   }
   return implode(' ', $sql);
 }
@@ -1178,6 +1190,13 @@ function drush_sql_db_exists($db_spec) {
       drush_shell_exec("$connect_no_db -Q \"$sql\"");
       $output = drush_shell_exec_output();
       return $output[0] == 1;
+    case 'oracle':
+      $user = $db_spec['username'];
+      $sql = "SELECT 1 AS result FROM all_users WHERE username='$user'";
+      $tmpfile = drush_save_data_to_temp_file(drush_sql_format_oracle($sql), '.sql');
+      drush_shell_exec("$connect_no_db @$tmpfile");
+      $output = drush_shell_exec_output();
+      return (bool)$output[0];
   }
 }
 
diff --git a/commands/sql/sync.sql.inc b/commands/sql/sync.sql.inc
index 2f5a872..c4ad76a 100644
--- a/commands/sql/sync.sql.inc
+++ b/commands/sql/sync.sql.inc
@@ -112,6 +112,10 @@ function sql_drush_sql_sync_sanitize($site) {
         $email_map = array('%uid' => "' || uid || '", '%mail' => "' || replace(mail, '@', '_') || '", '%name' => "' || replace(name, ' ', '_') || '");
         $newmail =  "'" . str_replace(array_keys($email_map), array_values($email_map), $newemail) . "'";
       }
+      elseif ($db_driver == 'oracle') {
+        $email_map = array('%uid' => "' || uid || '", '%mail' => "' || replace(mail, '@', '_') || '", '%name' => "' || replace(name, ' ', '_') || '");
+        $newmail =  "'" . str_replace(array_keys($email_map), array_values($email_map), $newemail) . "'";
+      }
       else {
         $email_map = array('%uid' => "', uid, '", '%mail' => "', replace(mail, '@', '_'), '", '%name' => "', replace(name, ' ', '_'), '");
         $newmail =  "concat('" . str_replace(array_keys($email_map), array_values($email_map), $newemail) . "')";
@@ -381,22 +385,36 @@ function drush_sql_sync($source = NULL, $destination = NULL) {
       // permissions to the specified user if said user was not created with this right.
       $pre_import_commands = '';
       $create_db = drush_sitealias_get_option($destination_settings, 'create-db');
+      $scheme = _drush_sql_get_scheme($target_db_url);
+      $create_db_file= '';
+
       if (isset($create_db)) {
         $create_db_su = drush_sql_su($target_db_url, $destination_settings);
         $db_su_connect = _drush_sql_connect($create_db_su);
         $pre_import_sql = drush_sql_build_createdb_sql($target_db_url);
-        $pre_import_commands = sprintf('echo "%s" | %s; ', $pre_import_sql, $db_su_connect);
+
+        if ($scheme=='oracle') {
+          $create_db_file = drush_save_data_to_temp_file(drush_sql_format_oracle($pre_import_sql), '.sql');
+          $pre_import_commands = sprintf("%s @%s; ", $db_su_connect, drush_escapeshellarg($create_db_file));
+        }
+        else
+          $pre_import_commands = sprintf('echo "%s" | %s; ', $pre_import_sql, $db_su_connect);
       }
 
       // Generate the import command
       $import_command = _drush_sql_connect($target_db_url);
-      switch (_drush_sql_get_scheme($target_db_url)) {
+      switch ($scheme) {
         case 'mysql':
           $import_command .= ' --silent';
           break;
         case 'pgsql':
           $import_command .= ' -q';
           break;
+        case 'oracle':
+          $target_db_spec = $target_db_url; 
+          $source_db_spec = ($source_db_url ? $source_db_url : $target_db_spec); 
+          $import_command = 'imp '.substr(_drush_sql_get_credentials($target_db_url),1).' fromuser='.$source_db_spec['username'].' touser='.$target_db_spec['username'].' file=';
+          break;
       }
 
       // If destination is remote, then use rsync to push the database, then use ssh to import the database
@@ -410,11 +428,26 @@ function drush_sql_sync($source = NULL, $destination = NULL) {
           $target_remote_pass = array_key_exists('remote-pass', $destination_settings) ? ':' . $destination_settings['remote-pass'] : '';
         }
 
+
+        if ($scheme=='oracle'&&!drush_core_call_rsync(drush_correct_absolute_path_for_exec($create_db_file, "RSYNC"), $target_remote_user . $target_at . $target_db_url['remote-host'] . ':' . $create_db_file, $target_rsync_options)) {
+          return FALSE;
+        }
+
         if (!drush_core_call_rsync(drush_correct_absolute_path_for_exec($local_file, "RSYNC"), $target_remote_user . $target_at . $target_db_url['remote-host'] . ':' . $target_dump, $target_rsync_options)) {
           return FALSE;
         }
 
-        $import_exec = $pre_import_commands . $import_command . ' < ' . drush_escapeshellarg($target_dump, $target_os);
+        if ($scheme=='oracle') {
+          $import_exec = $pre_import_commands . $import_command . drush_escapeshellarg($target_dump, $target_os);
+
+          // Delete the remote create_db file
+          if (!drush_is_windows($target_os))
+            $import_exec .= '; rm -f ' . drush_escapeshellarg($create_db_file, $target_os);
+        }
+        else
+          $import_exec = $pre_import_commands . $import_command . ' < ' . drush_escapeshellarg($target_dump, $target_os);
+
+
         // Delete the remote target file if it is a temporary file.
         if (!drush_is_windows($target_os) && $destination_settings['dump-is-temp']) {
           $import_exec .= '; rm -f ' . drush_escapeshellarg($target_dump, $target_os);
@@ -422,8 +455,12 @@ function drush_sql_sync($source = NULL, $destination = NULL) {
         // TODO: make sure that the remote tmp file is deleted on remote Windows machines.
       }
       else {
-        $import_exec = $pre_import_commands . $import_command . ' < ' . drush_escapeshellarg($local_file);
+        if ($scheme=='oracle')
+          $import_exec = $pre_import_commands . $import_command . drush_escapeshellarg($local_file);
+        else
+          $import_exec = $pre_import_commands . $import_command . ' < ' . drush_escapeshellarg($local_file);
       }
+
       $import_exec = _drush_backend_generate_command($destination_settings, $import_exec);
 
       drush_op_system($import_exec);
diff --git a/includes/environment.inc b/includes/environment.inc
index c7ff6b0..14d2468 100644
--- a/includes/environment.inc
+++ b/includes/environment.inc
@@ -403,8 +403,6 @@ function drush_valid_db_credentials() {
   }
   $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.
@@ -468,6 +466,7 @@ function drush_valid_db_credentials() {
       break;
     case 7:
     default:
+      $type = ( $type=='oracle' ? 'oci' : $type); // fix PDO driver name, should go away in Drupal 8
       // Drupal >=7 requires PDO and drush requires php 5.2, that ships with PDO
       // but it may be compiled with --disable-pdo.
       if (!class_exists('PDO')) {
