diff --git a/django/db/backends/oracle/client.py b/django/db/backends/oracle/client.py
index 102e77fd15..1a0e1ca10b 100644
--- a/django/db/backends/oracle/client.py
+++ b/django/db/backends/oracle/client.py
@@ -8,5 +8,5 @@ class DatabaseClient(BaseDatabaseClient):
def runshell(self):
conn_string = self.connection._connect_string()
- args = [self.executable_name, "-L", conn_string]
+ args = ['rlwrap', '--histsize', '2000', self.executable_name, "-L", conn_string]
subprocess.check_call(args)
I'd suggest trying it in the third party backend first. Also the history size probably doesn't need an easy way to specify, you could just give it sensible default on a class level attribute on the DatabaseClient class so if it *really* needs specifying, projects can subclass their own backend.