mirror of
https://github.com/nextcloud/documentation.git
synced 2025-10-26 11:18:02 +00:00
add oracle configuration
This commit is contained in:
parent
3978819497
commit
29fd06c48c
@ -166,6 +166,74 @@ ownCloud a password is very often not required to access the database.
|
||||
"dbhost" => "localhost",
|
||||
"dbtableprefix" => "",
|
||||
|
||||
Oracle Database
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
If you are deploying to an Oracle database make sure that you have installed
|
||||
and enabled the `Oracle extension <http://php.net/manual/en/book.oci8.php>`_ in PHP. The PHP configuration in :file:`/etc/php5/conf.d/oci8.ini` could look like this:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
# configuration for PHP Oracle extension
|
||||
extension=oci8.so
|
||||
|
||||
Make sure that the Oracle environment has been set up for the process trying to use the Oracle extension. For a local Oracle XE installation this can be done by exporting the following environment variables (eg. in :file:`/etc/apache2/envvars` for Apache)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
|
||||
|
||||
Installing and configuring Oracle support for PHP is way out of scope for this document. The official Oracle documentation called `The Underground PHP and Oracle Manual <http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html>`_ should help you through the process.
|
||||
|
||||
Creating a database user for ownCloud can be done by using the sqlplus command line
|
||||
interface or the Oracle Application Express web interface. The database tables will be created by ownCloud when you login for the first time.
|
||||
|
||||
On the command line connect to Oracle with a DBA account::
|
||||
|
||||
sqlplus system@localhost/XE
|
||||
|
||||
After entering the password a **SQL>** prompt will appear. Now enter the following lines and confirm them with the enter key:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
CREATE USER owncloud IDENTIFIED BY password;
|
||||
ALTER USER owncloud DEFAULT TABLESPACE users
|
||||
TEMPORARY TABLESPACE temp
|
||||
QUOTA unlimited ON users;
|
||||
GRANT create session
|
||||
, create table
|
||||
, create procedure
|
||||
, create sequence
|
||||
, create trigger
|
||||
, create view
|
||||
, create synonym
|
||||
, alter session
|
||||
TO owncloud;
|
||||
|
||||
.. note:: In Oracle creating a user is the same as creating a database in other RDBMs, so no ``CREATE DATABASE`` statement is necessary.
|
||||
|
||||
You can quit the prompt by entering::
|
||||
|
||||
exit
|
||||
|
||||
In the ownCloud configuration you need to set the hostname on which the
|
||||
database is running and a valid username and password to
|
||||
access it. If the database has been installed on the same server as
|
||||
ownCloud to config file could look like this:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
"dbtype" => "oci",
|
||||
"dbname" => "XE",
|
||||
"dbuser" => "owncloud",
|
||||
"dbpassword" => "password",
|
||||
"dbhost" => "localhost",
|
||||
|
||||
.. note:: This example assumes you are running an Oracle Express Edition on ``localhost``. The ``dbname`` is the name of the Oracle instance. For Oracle Express Edition it is always ``XE``.
|
||||
|
||||
Trouble Shooting
|
||||
----------------
|
||||
|
||||
@ -225,6 +293,24 @@ command line interface:
|
||||
(1 row)
|
||||
postgres=# \q
|
||||
|
||||
**Oracle**::
|
||||
|
||||
sqlplus username
|
||||
|
||||
::
|
||||
|
||||
SQL> select * from v$version;
|
||||
|
||||
BANNER
|
||||
--------------------------------------------------------------------------------
|
||||
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
|
||||
PL/SQL Release 11.2.0.2.0 - Production
|
||||
CORE 11.2.0.2.0 Production
|
||||
TNS for Linux: Version 11.2.0.2.0 - Production
|
||||
NLSRTL Version 11.2.0.2.0 - Production
|
||||
|
||||
SQL> exit
|
||||
|
||||
Useful SQL commands
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -232,22 +318,26 @@ Useful SQL commands
|
||||
|
||||
SQLite : No database user is required.
|
||||
MySQL : SELECT User,Host FROM mysql.user;
|
||||
PostgreSQL: SELECT * from pg_user;
|
||||
PostgreSQL: SELECT * FROM pg_user;
|
||||
Oracle : SELECT * FROM all_users;
|
||||
|
||||
**Show available Databases**::
|
||||
|
||||
SQLite : .databases (normally one database per file!)
|
||||
MySQL : SHOW DATABASES;
|
||||
PostgreSQL: \l
|
||||
Oracle : SELECT name FROM v$database; (requires DBA privileges)
|
||||
|
||||
**Show ownCloud Tables in Database**::
|
||||
|
||||
SQLite : .tables
|
||||
MySQL : USE owncloud; SHOW TABLES;
|
||||
PostgreSQL: \c owncloud; \d
|
||||
Oracle : SELECT table_name FROM user_tables;
|
||||
|
||||
**Quit Database**::
|
||||
|
||||
SQLite : .quit
|
||||
MySQL : quit
|
||||
PostgreSQL: \q
|
||||
Oracle : quit
|
||||
|
||||
Loading…
Reference in New Issue
Block a user