Skip to content

Instantly share code, notes, and snippets.

@murachi1208
Last active September 26, 2017 00:27
Show Gist options
  • Save murachi1208/6b0da5f2028ec51f58da to your computer and use it in GitHub Desktop.
Save murachi1208/6b0da5f2028ec51f58da to your computer and use it in GitHub Desktop.
Varagnt 環境の CentOS 6.6 に Oracle XE(11g Release 2) を導入してみる ref: http://qiita.com/murachi1208/items/36a226c40fdb8436ec7a
# OracleXE
config.vm.define :oracle do |oracle|
oracle.vm.hostname = "oracle"
oracle.vm.network :private_network, ip: "xxx.xxx.xxx.xxx"
oracle.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 512]
end
end
$ sudo yum -y install glibc make gcc binutils libaio libaio-devel bc unzip
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
$ cd /u01
$ sudo mkdir data
$ sudo chown oracle:oracle data
$ sqlplus system/passwd@XE
SQL> create tablespace MY_DATA datafile '/u01/MY_DATA.dbf' size 200M segment space management auto;
SQL> conn usr01
SQL> create table emp
(
emp_id char(3) ,
job_id char(3) ,
emp_name varchar2(10) ,
primary key( emp_id, job_id )
) tablespace MY_DATA;
SQL> desc emp;
$ sudo su
# unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
# cd Disk1
# rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm
# /etc/init.d/oracle-xe configure
Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:
Installation completed successfully.
$ sudo passwd oracle
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib/:/lib:/usr/lib
export NLS_LANG=Japanese_Japan.AL32UTF8
export NLS_DATE_FORMAT='YYYY/MM/DD HH24:MI:SS'
$ su - oracle
Password:
$ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
$ sqlplus /nolog
SQL> conn system
パスワードを入力してください:
接続されました。
SQL> select sysdate from dual;
SYSDATE
-------------------
2015/02/08 14:31:24
$ sqlplus /nolog
SQL> conn system
SQL> create user usr01 identified by 12345;
SQL> grant CONNECT,RESOURCE to usr01;
SQL> quit
$ sqlplus usr01/12345@XE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment