Last active
September 26, 2017 00:27
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo yum -y install glibc make gcc binutils libaio libaio-devel bc unzip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo passwd oracle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ su - oracle | |
Password: | |
$ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh | |
$ sqlplus /nolog | |
SQL> conn system | |
パスワードを入力してください: | |
接続されました。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> select sysdate from dual; | |
SYSDATE | |
------------------- | |
2015/02/08 14:31:24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sqlplus /nolog | |
SQL> conn system | |
SQL> create user usr01 identified by 12345; | |
SQL> grant CONNECT,RESOURCE to usr01; | |
SQL> quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sqlplus usr01/12345@XE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment