diff --git a/database/create_tablespaces.sql b/database/create_tablespaces.sql
new file mode 100644
index 0000000000000000000000000000000000000000..7ce550abf323c8059b2cb83605db885b81bd7ebc
--- /dev/null
+++ b/database/create_tablespaces.sql
@@ -0,0 +1,6 @@
+CREATE TABLESPACE dw_index_ts LOCATION '/home/index/dw_tablespace';
+CREATE TABLESPACE aggr_index_ts LOCATION '/home/index/aggr_tablespace';
+CREATE TABLESPACE aggr_table_ts LOCATION '/home/banco/aggr_tablespace';
+CREATE TABLESPACE dw_table_ts LOCATION '/home/banco/dw_tablespace';
+CREATE TABLESPACE sa_ts LOCATION '/home/banco/sa_tablespace';
+CREATE TABLESPACE le_save_conf_tablespace location '/home/banco/le_save_conf';
diff --git a/database/migracao_tablespace.py b/database/migracao_tablespace.py
new file mode 100644
index 0000000000000000000000000000000000000000..7ef7dffea37c8f37c2c8bbb38ea16b006e88b56f
--- /dev/null
+++ b/database/migracao_tablespace.py
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import psycopg2
+import sys
+
+dbName = "proinfodata"
+tablespace_table_dw = "dw_table_ts"
+tablespace_index_dw = "dw_index_ts"
+
+try:
+
+	con = psycopg2.connect(user = 'postgres', database = dbName, port = '5432')
+	db = con.cursor()
+
+	db.execute( "alter table %s.%s set tablespace %s" % ( 'public', 'aggr_availability', 'aggr_table_ts' ) )
+	db.execute("select * from pg_indexes where schemaname = '%s' and tablename = '%s' order by indexname" % ( 'public', 'aggr_availability'))
+	rows = db.fetchall()
+	for index in rows:
+		db.execute( "alter index %s.%s set tablespace %s" % ( 'public', index[2], 'aggr_index_ts' ) )
+
+	db.execute("alter table %s.%s set tablespace %s" % ('public', 'proinfo_inventory', 'sa_ts'))
+	db.execute( "select * from pg_indexes where schemaname = '%s' and tablename = '%s' order by indexname" % ( 'public', 'proinfo_inventory'))
+	rows = db.fetchall()
+	for index in rows:
+		db.execute( "alter index %s.%s set tablespace %s" % ( 'public', index[2], 'sa_ts' ) )
+
+	db.execute( "alter table %s.%s set tablespace %s" % ( 'public', 'proinfo_net_usage', 'sa_ts' ) )
+	db.execute( "select * from pg_indexes where schemaname = '%s' and tablename = '%s' order by indexname" % ( 'public', 'proinfo_net_usage'))
+	rows = db.fetchall()
+	for index in rows:
+		db.execute( "alter index %s.%s set tablespace %s" % ( 'public', index[2], 'sa_ts' ) )
+
+	db.execute("select * from pg_tables where tablename != 'aggr_availability' and tablename != 'proinfo_inventory' and tablename != 'proinfo_net_usage' order by tablename")
+	rows_tables = db.fetchall()
+	for table in rows_tables:
+		schemaName = table[0]
+		if schemaName == "public":
+			tableName = table[1]
+			db.execute( "alter table %s.%s set tablespace %s" % ( schemaName, tableName, tablespace_table_dw ) )
+			db.execute( "select * from pg_indexes where schemaname = '%s' and tablename = '%s' order by indexname" % ( schemaName, tableName ))
+			rows_indexes = db.fetchall()
+			for index in rows_indexes:
+				db.execute( "alter index %s.%s set tablespace %s" % ( schemaName, index[2], tablespace_index_dw ) )
+
+	con.commit()
+
+except psycopg2.DatabaseError, e:
+	if con:
+		con.rollback()
+
+	print 'Error %s' % e
+	sys.exit(1)
+
+finally:
+	if con:
+		con.close()