Change the file /etc/apt/sources.list and add the following line to it. The line describes the repository position for debian from oracle.
deb http://oss.oracle.com/debian unstable main non-free
When I use the command mode to install the oracle-xe and oracle-xe-client, it says it will remove a lot of package. I don't know why.
aptitude install oracle-xe oracle-xe-client
Then I abort the procedures. And resort to the Synaptic Package Manager . At last, in the GUI Package Manager I installed the 2 packages successfully, oracle-xe and oracle- xe-client.
Then config the instance and database sys/system users.
/etc/init.d/oracle-xe configure In this steps, you will need to specify the ports and pasword. The details for my installation are as follows, Webconsole Http Port: 1158 Database Listener: 1521 Database Password: *******
At this point we must say, we have installed two programs. One is oracle server and another is oracle client. In the bin directory in their root path, they all have a sqlplus client to use. Actually, the one in server side connects the database with local protocol, it don't need the network(for OS user login, it login directly, for the other user, it login with /app/oracle/product/10.2.0/server/network/admin/tnsnames.ora ). So it has more rights. Then one in client need the file /etc/tnsnames.ora to connect to db. Oracle and Oracle client ships with a shell to set the environment. We can source them like this,
Firstly, we need setup some users. So I login with sqlplus in server site. Before doing this, make sure the oracle user(automatically added by installer) belongs to the dba group. Only the oracle can be used to login dba with OS user, root can't. (Because I login after I login with sys and password I specified during installation, I can't login, it says Invalide Username or password . So I need this step to specify password again)
su oracle source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh sqlplus / as sysdba alter user sys identified by ******* alter user system identified by *******
create user robert identifed by ********** default tablespace users temporary tablespace temp quota unlimited on users
grant create session,create table, create view, create procedure, create synonym to robert
Now the user sys/system/robert can be used to login database. You can use the command to login,
sqlplus sys/*******@xe as sysdba sqlplus system/*******@xe sqlplus robert/**********@xe
Until now, you are using the sqlplus from server site, you can login with OS user - oracle, you also can login with the sys/system users and your own user - robert.
Now we start to investigate how to login oracle with remote sqlplus - the on in client site.
Login web manager console, because oracle install the oracle server based on the loopback network adaptor, that is to say, you only can access web console by the loopback adaptor currently.
See my /etc/hosts file, 127.0.0.1 localhost 127.0.1.1 debianlaptop
That is to say, the 127.0.0.1(localhost) is an alias of the loopback adaptor while the 127.0.0.1(debianlaptop, 192.168.0.100) is an alias of my real network adaptor.
For the first time, oracle only bind itself with the loopback one. So you only can access it by
Now you can login web console with sys/*******, go to Administratoin item. In the right sidebar Task , click the link. Then enable the item Available from local server and remote clients.
Then you can login with the following address to console. This is the ip address of my real network adaptor.
That is to say, it use the tnsnames.ora from /etc diretory. Without last step and the right one before last step, you can't login in the client sqlplus.