Ubuntu 16.04 install Oracle XE 11G R2

Some advanced methods of oracle Xe are not supported, and the installer needs to consider clearly

The installation environment is the Ubuntu16.04 version, and the official oracle Xe is Linux 64 and the Rpm package. Rpm packages cannot be installed directly and need to be converted using Alien. Alien installation command

sudo apt-get install alien

Note adding the parameter -c, otherwise there will be a warning. Note that the RPM package needs to be copied to the EXT4 hard disk, and the conversion will fail under NTFS.

dhlsoft@djpc:~/tool$ sudo alien oracle-xe-11.2.0-1.0.x86_64.rpm 
Warning: Skipping conversion of scripts in package oracle-xe: postinst postrm preinst prerm
Warning: Use the --scripts parameter to include the scripts.
dhlsoft@djpc:~/tool$ sudo alien -c oracle-xe-11.2.0-1.0.x86_64.rpm

The conversion process is very slow and takes about ten minutes, and there is no prompt message during that time. You need to wait patiently for the conversion to complete. Under the path of the rpm package, a .deb package with the same name will be generated. The next step is to install

dhlsoft@djpc:~/tool$ sudo chmod 777 oracle-xe_11.2.0-2_amd64.deb

dhlsoft@djpc:~/tool$ sudo dpkg -i oracle-xe_11.2.0-2_amd64.deb 
正在选中未选择的软件包 oracle-xe。
(正在读取数据库 ... 系统当前共安装有 179032 个文件和目录。)
正准备解包 oracle-xe_11.2.0-2_amd64.deb  ...
正在解包 oracle-xe (11.2.0-2) ...
正在设置 oracle-xe (11.2.0-2) ...
Executing post-install steps...
/var/lib/dpkg/info/oracle-xe.postinst: 行 114: /sbin/chkconfig: 没有那个文件或目录
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

正在处理用于 libc-bin (2.23-0ubuntu3) 的触发器 ...
正在处理用于 gnome-menus (3.13.3-6ubuntu3) 的触发器 ...
正在处理用于 desktop-file-utils (0.22-1ubuntu5) 的触发器 ...
正在处理用于 bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) 的触发器 ...
Rebuilding /usr/share/applications/bamf-2.index...
正在处理用于 mime-support (3.59ubuntu1) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
ureadahead will be reprofiled on next reboot
正在处理用于 systemd (229-4ubuntu4) 的触发器 ...

The installation will be completed soon, during which you will be prompted that you need to use the root user for configuration. An error will be reported when this command is run, /sbin/chkconfig does not exist. Check the /var/lib/dpkg/info/oracle-xe.postinst script and find the following paragraph in the script:

if [ -f /etc/SuSE-release ]
then cp -f /u01/app/oracle/product/11.2.0/xe/config/scripts/oracle-xe.sles /etc/init.d/oracle-xe /usr/lib/lsb/install_initd /etc/init.d/oracle-xe > /dev/null 2>&1
/sbin/insserv /etc/init.d/oracle-xe > /dev/null 2>&1
/sbin/SuSEconfig > /dev/null 2>&1
#else
#/sbin/chkconfig --add oracle-xe
fi

Comment out line 113 of the bolded part above, and then execute

Configure oracle xe sudo /etc/init.d/oracle-xe configure Select web management port default 7070 Select port default 1521 Enter administrator password and confirm password (sys password) Finally ask you whether to automatically start the default y So far, the basic installation has ended, this is executed in the terminal

Initialize the database:

su oracle

If you don't know the password, you can use # passwd oracle to reset and modify init.ora: cd /u01/app/oracle/product/11.2.0/xe/dbs/ cp init.ora initXE.ora vi initXE.ora Modify the file to The following: db_name='XE' memory_target=1G processes = 150 audit_file_dest='/u01/app/oracle/admin/XE/adump' audit_trail ='db' db_block_size=8192 db_domain='' db_recovery_file_dest='/u01/app/ oracle/fast_recovery_area' db_recovery_file_dest_size=2G diagnostic_dest='/u01/app/oracle' dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1'

You may want to ensure that control files are created on separate physical

devices

control_files = ('/u01/app/oracle/oradata/', '/u01/app/oracle/oradata/') compatible ='11.2.0'

lsnrctl start If it is found that the command lsnrctl cannot be found, the environment variable is not configured, and the environment variable is added in the terminal execution #vi ~/.bashrc Add the following code at the end of the file export ORACLE_HOME=/u01/app/oracle/product/11.2.0/ xe export ORACLE_SID=XE export NLS_LANG= $ORACLE_HOME/bin/nls_lang.shexport ORACLE_BASE=/u01/app/oracle export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export PATH=$ORACLE_HOME/bin:$PATH #source ~/.bashrc su oracle lsnrctl start should work Successfully or unsuccessfully execute the installation dependency package sudo apt-get install libaio1 and then execute lsnrctl start

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325245348&siteId=291194637