Oracle has set up a dedicated apt source server for Ubuntu users. You only need to add a line in/etc/apt/source. list:
Deb http://oss.oracle.com/debian unstable main non-free
You can. Before running the apt-get update command, you must add the public key of the source server to the keystore of the local apt system. First download the public key:
Wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle
After the download is complete, add the public key to the keystore:
Sudo apt-key add RPM-GPG-KEY-oracle
Run again
Sudo apt-get update
Synchronize the software package index file.
We can download and install Oracle 10g Express Edition from this source. You can select the following software packages:
Oracle-xe-Oracle Database 10g Express Western European Edition
Oracle-xe-client-Oracle Client 10g Express Edition
Oracle-xe-universal-Oracle Database 10g Express Universal Edition
Because I only need to install a local client to connect to the Oracle server, I chose to install the oralce-xe-client package.
Sudo apt-get install oracle-xe-client
After the installation is successful, you also need to set relevant environment variables. Edit/etc/environment and add the following lines: (copy it directly. Otherwise, ORACLE_HOME is a directory)
ORACLE_HOME =/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
LD_LIBRARY_PATH = $ ORACLE_HOME/lib: $ LD_LIBRARY_PATH
TNS_ADMIN =/usr/lib/oracle
PATH = $ PATH: $ ORACLE_HOME
After saving the file, run
Source/etc/environment
The environment variables that have been set immediately take effect on the current terminal. Switch to the/usr/lib/oracle directory and create the tnsnames. ora file to configure the connection information of the Oracle server.
After all the work is done, you can connect to the Oracle server locally for development.
If SQLPLUS is enabled
/Usr/lib/oracle/xe/application/oracle/product/10.2.0/client/bin/nls_lang.sh: 112: [[: not found
Then: vim/Usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin/nls_lang.sh
Original content:
If [[-n "$ LC_ALL"]; then
Locale = $ LC_ALL
Elif [[-n "$ LANG"]; then
Locale = $ LANG
Else
Locale =
Fi
Modify:
If [-n "$ LC_ALL"]; then
Locale = $ LC_ALL
Elif [-n "$ LANG"]; then
Locale = $ LANG
Else
Locale =
Fi
You can.