This is a quick and dirty installation of sql*plus in debian based systems.
1. Download sql plus
oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm
2. Install 'alien'
#apt-get install alien
3. Install rpms
#alien -i oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
#alien -i oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
#alien -i oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm
4. Install Linux kernel AIO library
# apt-get install libaio1
5. oracle.conf
# touch /etc/ld.so.conf.d/oracle.conf
# echo "/usr/lib/oracle/12.1/client/lib/" >> /etc/ld.so.conf.d/oracle.conf
6. configure dynamic linker run-time bindings
# ldconfig
7. Edit ~/.bash_profile and export oracle client path.
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
7. Create the following file.
# touch $ORACLE_HOME/network/admin/tnsnames.ora
8. connect to a db
# sqlplus user/password@192.168.1.8:1521/orcl
Tuesday, November 26, 2013
Saturday, November 16, 2013
django mysql exception
After facing some compatibility issues of my system, I upgraded my debian squeeze to wheezy. I used Python2.6 and the latest distro upgrade gave 2.7 version, which cause me to fix so many dependencies of my django project. This is one issue I faced.
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/base.py", line 264, in add_to_class
value.contribute_to_class(cls, name)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/options.py", line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 198, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 113, in load_backend
return import_module('%s.base' % backend_name)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
Solution:
install "python-mysqldb" "libmysqlclient-dev" from distro repositories.
install "django"
install "mysql-python" from pip.
$ pip install mysql-python
run "python manage.py syncdb" again.
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/base.py", line 264, in add_to_class
value.contribute_to_class(cls, name)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/options.py", line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 198, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 113, in load_backend
return import_module('%s.base' % backend_name)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
Solution:
install "python-mysqldb" "libmysqlclient-dev" from distro repositories.
install "django"
install "mysql-python" from pip.
$ pip install mysql-python
run "python manage.py syncdb" again.
Tuesday, November 12, 2013
Subscribe to:
Posts (Atom)