Oracle 11g EX on Centos 6 x64 vps
We describe how to install Oracle 11g Express on Centos 6 x86_64 Openvz VPS.
First of all you need to use vps with next config: min RAM: 1Gb, 2Gb Swap
-OR-
reccomended conf: 2GB RAM, 2GB swap/VSwap
also can be used some kind of Burs. RAM here: 1.5Gb, Burst 2.5Gb, 2Gb swap/VSwapAnyway in case of swap not present on your system or there will be not enought memory - you will face an error during instaliation. Please check logs if you can't install.
You need to create a support request if you want that we enabled swap for your vps.
NOTE: use only 64 bit Centos version
Check is swap enabled for your vps:
#cat /proc/swaps Filename Type Size Used Priority /dev/null partition 2097152 4664 -1install the packages for libaio, bc, flex:
yum install libaio bc flexdownload oracle rpm oracle-xe-11.2.0-1.0.x86_64.rpm.zip from http://www.oracle.com/technetwork/products/express-edition/downloads/index.html Unzip archive:
unzip -q oracle-xe-11.2.0-1.0.x86_64.rpm.zipDirectory Disk1 should be created after unzip.
cd Disk1 rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpmYou will see output like this:
# rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm Preparing... ########################################### [100%] error: permission denied on key 'fs.file-max' 1:oracle-xe ########################################### [100%] Executing post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.Run next command for configure and start DB:
/etc/init.d/oracle-xe configureThen you should Specify the HTTP port that will be used for Oracle Application Express [default 8080] and a port that will be used for the database listener [default 1521]. Install process can take a few minutes . When it's finished you be able to see next output:
Starting Oracle Net Listener...Done Configuring database...Done Starting Oracle Database 11g Express Edition instance...Done Installation completed successfully.The installation created the directory /u01 under which Oracle XE is installed.
To set the environment for your current session run '. ./oracle_env.sh' from /u01 dir (/u01/app/oracle/product/11.2.0/xe/bin/):[root@host]# . ./oracle_env.sh
To set the environment permanently for users, add the following to the .bashrc or .bash_profile of the users you want to access the environment:. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
You should now be able to access SQL*Plus
[root@host]# sqlplus /nolog SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 21 08:17:26 2011 Copyright (c) 1982, 2011, Oracle. All rights reserved. SQL> connect sys/Password as sysdba Connected. SQL>
To allow remote access to Oracle 11g XE GUI (as well as Application Express GUI) issue the following from SQL*PlusSQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE); PL/SQL procedure successfully completed.
You should now be able to access the Oracle 11g XE Home Page GUI at:http://localhost:8080/apex/f?p=4950:1Log in as SYSTEM using the password you selected above.
rewrited from here: http://www.davidghedini.com/pg/entry/install_oracle_11g_xe_on
If you need to configure the php and oci8 for Oracle refer to this guide:http://wiki.vpsget.com/index.php/Php go to "Using pecl" section.
Some troubleshoots
Start Oracle DB:
/etc/init.d/oracle-xe start
Manage Oracle sqlplus in consolesu - oracleSet environment:
-bash-4.1$ cd /u01/app/oracle/product/11.2.0/xe/bin/ -bash-4.1$ . ./oracle_env.shTo enter in listener:
lsnrctlTo check status if case of issues:
lsnrctl statusEnter to sqlplus and perform the next:
sqlplus /nolog SQL> connect sys/Password as sysdba Connected to an idle instance.Use STARTUP command to start DB if it not started
Connect to Oracle DB. In Oracle username=dbname:
-bash-4.1$ sqlplus SQL*Plus: Release 11.2.0.2.0 Production on Wed Oct 30 22:08:09 2013 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter user-name: <name> Enter password:Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
ORACLE BASIC ACTIONS
Oracle show databases
SQL> SELECT DISTINCT OWNER FROM ALL_OBJECTS;Oracle show users
SQL> select * from all_users;Oracle create user
SQL> Create user username identified by password account unlock;Oracle delete user
SQL> drop user username cascade;Oracle grant dba privileges
SQL> grant create session, dba to username;Oracle change user's password
SQL> alter user username identified by new_password replace old_password;ORACLE BACKUP AND RESTORE
Oracle backup database (dump database)
# expdp username/password schemas=username dumpfile=filename.dmpOracle restore database (import database)
# imp username/password schemas=username file=filename.dmp
Show DB Name:
SELECT NAME FROM v$database;Show tables for currrent DB:
select table_name from all_tables;Show tables from DB with differ look:
select * from v$database;
If you cant start oracle / connect to sqlplus under the oracle user then check next.
sqlplus connect / as sysdba ORA-09925: Unable to create audit trail file Linux-x86_64 Error: 30: Read-only file systemYou should check the trail file.get the location of your audit directory from spfile or pfile
strings -a sp<SID>.ora | grep -i auditExample:
strings -a sp /u01/app/oracle/product/11.2.0/xe/dbs/spfileXE.ora | grep -i audit *.audit_file_dest='/u01/app/oracle/admin/XE/adump'And set the right permissions. Better to make backup before.