サポート対象外ではあるが、ubuntu16.10 に oracle12c(12.1.0.2.0) をインストールする際、以下のようなエラーが発生する。
/usr/bin/ld: /u01/app/oracle/product/12.1.0/dbhome_1/lib//libpls12.a(plzsql.o): relocation R_X86_64_32 against`.rodata.str1.4' can not be used when making a shared object。 -fPIC を付けて再コンパイルしてください。
/usr/bin/ld: 最終リンクに失敗しました: 出力に対応するセクションがありません
このエラーには、該当箇所に -no-pie オプションを付与することで解決した。
※このエラーについては、
「Ubuntu 16 で Stack + GHC がライブラリのリンクに失敗する場合の対処法」 を参照させて頂いた。
省力化のため、この問題も含めインストール中に出るエラーの対策をまとめた patch と
oracle12c(12.1.0.2.0) をインストールする前準備のシェルを作成した。
なお、この手順は VirtualBox に ubuntu16.10 をインストールし、2017/03/19日時点までの
update を当てておこなった。
1.事前準備として以下の構成のディレクトリを作成
/mnt/vbox/share/oracle12c
|-- database : linuxamd64_12102_database_[12]of2.zip を展開
`-- inst12c : inst12c.tar.gz を展開
2.oracle12c が要求する各種設定を適用
$ sudo -s
# cd /mnt/vbox/share/oracle12c/inst12c
# ./inst12c.sh
※inst12c.sh の内容は、
「oracle12c が要求する各種設定を一括設定」
を参照
3.oracle12c のインストール
# cd /mnt/vbox/share/oracle12c/database/install
# cp /usr/bin/unzip .
# passwd oracle
Changing password for user oracle.
New UNIX password: <oracle ユーザーパスワード>
Retype new UNIX password: <oracle ユーザーパスワード>
passwd: all authentication tokens updated successfully.
# xhost +
# su - oracle
$ cd /mnt/vbox/share/oracle12c/database
$ ./runInstaller -jreloc /usr/lib/jvm/default-java
4.エラーが発生したら patch を適用
$ cd /u01/app/oracle/product/12.1.0/dbhome_1
$ patch -p1 -d . < /mnt/vbox/share/oracle12c/inst12c/ora12c_12.1.0.2.0-ubuntu.patch
<再施行>
$ exit
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product12.1.0/dbhome_1/root.sh
# su - oracle
diff -u -r dbhome_1.org/ctx/lib/env_ctx.mk dbhome_1.new/ctx/lib/env_ctx.mk
--- dbhome_1.org/ctx/lib/env_ctx.mk 2014-06-19 02:34:58.000000000 +0900
+++ dbhome_1.new/ctx/lib/env_ctx.mk 2017-03-21 01:04:03.983538030 +0900
@@ -293,7 +293,9 @@
LLPPATH=$(LD_LIBRARY_PATH)
LINKEXSYSLIBS= $(SHAREDLIBPATH)
-LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+# 2017/03/20
+# LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR) -no-pie
SUIDLINKLDLIBS=$(LINKLDLIBS:$(SHAREDLIBPATH)=)
OPTIMIZE0=-O0
diff -u -r dbhome_1.org/ctx/lib/ins_ctx.mk dbhome_1.new/ctx/lib/ins_ctx.mk
--- dbhome_1.org/ctx/lib/ins_ctx.mk 2014-06-19 02:34:58.000000000 +0900
+++ dbhome_1.new/ctx/lib/ins_ctx.mk 2017-03-21 01:05:20.000824602 +0900
@@ -7,11 +7,17 @@
ctxload: $(DRZ)
$(CTXLOAD_LINKLINE)
+# 2017/03/20
+# ctxhx: $(CTXHXOBJ)
+# $(CTXHX_LINKLINE)
ctxhx: $(CTXHXOBJ)
- $(CTXHX_LINKLINE)
+ $(CTXHX_LINKLINE) -no-pie
+# 2017/03/20
+# ctxlc: $(DRLLC)
+# $(CTXLC_LINKLINE)
ctxlc: $(DRLLC)
- $(CTXLC_LINKLINE)
+ $(CTXLC_LINKLINE) -no-pie
ctxkbtc: $(KBTC_OBJS)
$(CTXKBTC_LINKLINE)
diff -u -r dbhome_1.org/network/lib/ins_net_server.mk dbhome_1.new/network/lib/ins_net_server.mk
--- dbhome_1.org/network/lib/ins_net_server.mk 2013-08-21 01:21:46.000000000 +0900
+++ dbhome_1.new/network/lib/ins_net_server.mk 2017-03-22 01:41:30.315395708 +0900
@@ -23,10 +23,15 @@
INSTALL_TARGS=clean $(INSTALL_NET_SERVER_TARGS)
+# 2017/03/20
+# tnslsnr: $(S0NSGL) $(SNSGLP) $(NSGLPNP)
+# $(SILENT)$(ECHO) " - Linking $(TNSLSNR)"
+# $(RMF) $@
+# $(TNSLSNR_LINKLINE)
tnslsnr: $(S0NSGL) $(SNSGLP) $(NSGLPNP)
$(SILENT)$(ECHO) " - Linking $(TNSLSNR)"
$(RMF) $@
- $(TNSLSNR_LINKLINE)
+ $(TNSLSNR_LINKLINE) -lnnz12 -lons
itnslsnr: tnslsnr
-$(MV) -f $(BINHOME)tnslsnr $(BINHOME)tnslsnr0
diff -u -r dbhome_1.org/plsql/lib/env_plsql.mk dbhome_1.new/plsql/lib/env_plsql.mk
--- dbhome_1.org/plsql/lib/env_plsql.mk 2014-07-07 02:05:06.000000000 +0900
+++ dbhome_1.new/plsql/lib/env_plsql.mk 2017-03-21 01:01:50.601318164 +0900
@@ -293,7 +293,9 @@
LLPPATH=$(LD_LIBRARY_PATH)
LINKEXSYSLIBS= $(SHAREDLIBPATH)
-LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+# 2017/03/20
+# LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR) -no-pie
SUIDLINKLDLIBS=$(LINKLDLIBS:$(SHAREDLIBPATH)=)
OPTIMIZE0=-O0
diff -u -r dbhome_1.org/precomp/lib/env_precomp.mk dbhome_1.new/precomp/lib/env_precomp.mk
--- dbhome_1.org/precomp/lib/env_precomp.mk 2014-07-07 03:32:20.000000000 +0900
+++ dbhome_1.new/precomp/lib/env_precomp.mk 2017-03-21 01:02:19.189789433 +0900
@@ -293,7 +293,9 @@
LLPPATH=$(LD_LIBRARY_PATH)
LINKEXSYSLIBS= $(SHAREDLIBPATH)
-LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+# 2017/03/20
+# LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR) -no-pie
SUIDLINKLDLIBS=$(LINKLDLIBS:$(SHAREDLIBPATH)=)
OPTIMIZE0=-O0
diff -u -r dbhome_1.org/rdbms/lib/env_rdbms.mk dbhome_1.new/rdbms/lib/env_rdbms.mk
--- dbhome_1.org/rdbms/lib/env_rdbms.mk 2014-07-07 02:05:02.000000000 +0900
+++ dbhome_1.new/rdbms/lib/env_rdbms.mk 2017-03-22 01:48:43.559812976 +0900
@@ -295,7 +295,9 @@
LLPPATH=$(LD_LIBRARY_PATH)
LINKEXSYSLIBS= $(SHAREDLIBPATH)
-LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+# 2017/03/20
+# LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR)
+LINKLDLIBS=$(EXPDLIBS) $(EXOSLIBS) $(SYSLIBS) $(LINKEXSYSLIBS) $(MATHLIB) $(USRLIBS) $(LDLIBS) $(COMPEOBJS) -L$(ORACLE_HOME)/$(LIBDIR) -no-pie
SUIDLINKLDLIBS=$(LINKLDLIBS:$(SHAREDLIBPATH)=)
OPTIMIZE0=-O0
@@ -3001,7 +3003,10 @@
DPSADDC=$(RDBMSBIN)drdaddmc$(EXE_SUFFIX)
DPSADDFD=$(RDBMSBIN)drdadfd$(EXE_SUFFIX)
-ORACLE_LINKLINE=$(ORACLE_LINKER) $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
+# 2017/03/20
+# ORACLE_LINKLINE=$(ORACLE_LINKER) $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
+# $(ORACLE_KERNEL_LIBS) $(LINKLDLIBS)
+ORACLE_LINKLINE=$(ORACLE_LINKER) -Wl,--no-as-needed $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
$(ORACLE_KERNEL_LIBS) $(LINKLDLIBS)
IMP_LINKLINE=$(LINK) $(OPT) $(IMPMAI) $(SSDBED) $(LLIBDBTOOLS) \
$(LINKTTLIBS)
@@ -3078,17 +3083,28 @@
$(LDFLAGSLIST) $(LINKTTLIBS)
TDSCOMP_LINKLINE=$(LINK) $(OPT) $(TDSMAI) $(TDSOBJS) $(SSDBED) \
$(LINKTTLIBS)
-EXTPROC_LINKLINE=$(LINK) $(OPT) $(EXTPMAI) $(PROD_EXTPROC_OPT) \
+# 2017/03/20
+# EXTPROC_LINKLINE=$(LINK) $(OPT) $(EXTPMAI) $(PROD_EXTPROC_OPT) \
+# $(HSALIB_SUBSET1) $(HSALIB_SUBSET2)
+EXTPROC_LINKLINE=$(LINK) $(OPT) -Wl,--no-as-needed $(EXTPMAI) $(PROD_EXTPROC_OPT) \
$(HSALIB_SUBSET1) $(HSALIB_SUBSET2)
AGTCTL_LINKLINE=$(LINK) $(OPT) $(AGTCLMAI) $(HSALIB_SUBSET1) \
$(AGTCLSUR) $(LLIBVSN) $(HSALIB_SUBSET2)
HSALLOCI_LINKLINE=$(LINK) $(OPT) $(HSALLMAI) $(HSALIB_SUBSET1) \
$(HS_OCI_DRIVER) $(HS_XASWITCH_ORA) $(RDBMSLIB)$(XAD_OFF) \
$(HSALIB_SUBSET2)
-HSDEPXA_LINKLINE=$(LINK) $(OPT) $(HSDEPMAI) $(HSALIB_SUBSET1) \
+# 2017/03/20
+# HSDEPXA_LINKLINE=$(LINK) $(OPT) $(HSDEPMAI) $(HSALIB_SUBSET1) \
+# $(HS_DEP_DRIVER) $(RDBMSLIB)$(XAD_OFF) \
+# $(HSALIB_SUBSET2)
+HSDEPXA_LINKLINE=$(LINK) $(OPT) -Wl,--no-as-needed $(HSDEPMAI) $(HSALIB_SUBSET1) \
$(HS_DEP_DRIVER) $(RDBMSLIB)$(XAD_OFF) \
$(HSALIB_SUBSET2)
-HSOTS_LINKLINE=$(LINK) $(OPT) $(HSOTSMAI) $(HSALIB_SUBSET1) \
+# 2017/03/20
+# HSOTS_LINKLINE=$(LINK) $(OPT) $(HSOTSMAI) $(HSALIB_SUBSET1) \
+# $(HS_OTS_DRIVER) $(HS_XASWITCH_ORA) $(RDBMSLIB)$(XAD_OFF) \
+# $(HSALIB_SUBSET2)
+HSOTS_LINKLINE=$(LINK) $(OPT) -Wl,--no-as-needed $(HSOTSMAI) $(HSALIB_SUBSET1) \
$(HS_OTS_DRIVER) $(HS_XASWITCH_ORA) $(RDBMSLIB)$(XAD_OFF) \
$(HSALIB_SUBSET2)
HSODBC_LINKLINE= $(LINK) $(OPT) $(HSODBCMAI) $(HSALIB_SUBSET1) \
@@ -3155,7 +3171,11 @@
ORATNT_LINKLINE=$(LINK) $(S0MAIN) $(SSTNTED) $(STNTPT) \
$(LLIBDBTOOLS) $(LLIBSLAX) $(LINKTTLIBS)
-KFED_LINKLINE=$(LINK) $(S0MAIN) $(SSKFEDED) $(SKFEDPT) \
+# 2017/03/20
+# KFED_LINKLINE=$(LINK) $(S0MAIN) $(SSKFEDED) $(SKFEDPT) \
+# $(LLIBDBTOOLS) $(LLIBCLNTSH) $(LLIBNNZ) $(LLIBSAGE) \
+# $(LLIBSKGXP) $(CSSCLNTLIBS_SERVER) $(LLIBASMCLNT) $(LINKTTLIBS)
+KFED_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFEDED) $(SKFEDPT) \
$(LLIBDBTOOLS) $(LLIBCLNTSH) $(LLIBNNZ) $(LLIBSAGE) \
$(LLIBSKGXP) $(CSSCLNTLIBS_SERVER) $(LLIBASMCLNT) $(LINKTTLIBS)
@@ -3164,11 +3184,20 @@
$(LIBGENERIC) $(LLIBSAGE) $(LLIBSKGXP) $(LIBCORE) \
$(CSSCLNTLIBS) $(LLIBASMCLNT) $(LINKTTLIBS)
-KFNDG_LINKLINE=$(LINK) $(S0MAIN) $(SSKFNDGED) $(SKFNDGPT) $(KFNDGOBJ) \
+# 2017/03/20
+# KFNDG_LINKLINE=$(LINK) $(S0MAIN) $(SSKFNDGED) $(SKFNDGPT) $(KFNDGOBJ) \
+# $(LLIBCLNTSH) $(LIBGENERIC) $(DEF_OPT) $(LLIBDBTOOLS) $(LIBGENERIC) \
+# $(LIBCORE) $(CSSCLNTLIBS) $(ASMCLNT_LIBS) $(LINKTTLIBS)
+KFNDG_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFNDGED) $(SKFNDGPT) $(KFNDGOBJ) \
$(LLIBCLNTSH) $(LIBGENERIC) $(DEF_OPT) $(LLIBDBTOOLS) $(LIBGENERIC) \
$(LIBCORE) $(CSSCLNTLIBS) $(ASMCLNT_LIBS) $(LINKTTLIBS)
-AMDU_LINKLINE=$(LINK) $(S0MAIN) $(SSKFMUED) $(SKFMUPT) $(LLIBCLNTSH) \
+# 2017/03/20
+# AMDU_LINKLINE=$(LINK) $(S0MAIN) $(SSKFMUED) $(SKFMUPT) $(LLIBCLNTSH) \
+# $(LLIBDBTOOLS) $(LLIBCORE) $(LLIBGENERIC) $(LLIBUNLSRTL) \
+# $(LLIBNLSRTL) $(LLIBCORE) $(LLIBSAGE) $(LLIBSKGXP) \
+# $(LLIBNLSRTL) $(CSSCLNTLIBS) $(LLIBASMCLNT) $(LINKTTLIBS)
+AMDU_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFMUED) $(SKFMUPT) $(LLIBCLNTSH) \
$(LLIBDBTOOLS) $(LLIBCORE) $(LLIBGENERIC) $(LLIBUNLSRTL) \
$(LLIBNLSRTL) $(LLIBCORE) $(LLIBSAGE) $(LLIBSKGXP) \
$(LLIBNLSRTL) $(CSSCLNTLIBS) $(LLIBASMCLNT) $(LINKTTLIBS)
diff -u -r dbhome_1.org/rdbms/lib/ins_rdbms.mk dbhome_1.new/rdbms/lib/ins_rdbms.mk
--- dbhome_1.org/rdbms/lib/ins_rdbms.mk 2014-07-07 02:05:02.000000000 +0900
+++ dbhome_1.new/rdbms/lib/ins_rdbms.mk 2017-03-22 01:39:19.960858833 +0900
@@ -874,11 +874,17 @@
$(RMF) $@
$(MAXMEM_LINKLINE)
+# 2017/03/20
+# $(ORAPWD) : $(ALWAYS) $(ORAPWD_DEPS)
+# $(SILENT)$(ECHO)
+# $(SILENT)$(ECHO) " - Linking password utility (orapwd)"
+# $(RMF) $@
+# $(ORAPWD_LINKLINE)
$(ORAPWD) : $(ALWAYS) $(ORAPWD_DEPS)
$(SILENT)$(ECHO)
$(SILENT)$(ECHO) " - Linking password utility (orapwd)"
$(RMF) $@
- $(ORAPWD_LINKLINE)
+ $(ORAPWD_LINKLINE) -lnnz12
$(TKPROF) : $(ALWAYS) $(TKPROF_DEPS)
$(SILENT)$(ECHO)
@@ -923,11 +929,17 @@
$(RMF) $@
$(TDSCOMP_LINKLINE)
+# 2017/03/20
+# $(EXTPROC): $(ALWAYS) $(EXTPROC_DEPS)
+# $(SILENT)$(ECHO)
+# $(SILENT)$(ECHO) "Linking external procedure agent ($@)"
+# $(RMF) $@
+# $(EXTPROC_LINKLINE)
$(EXTPROC): $(ALWAYS) $(EXTPROC_DEPS)
$(SILENT)$(ECHO)
$(SILENT)$(ECHO) "Linking external procedure agent ($@)"
$(RMF) $@
- $(EXTPROC_LINKLINE)
+ $(EXTPROC_LINKLINE) -lagtsh
extproc32:
$(MAKE) -f $(LINKMAKEFILE) $(EXTPROC32) EXTPROC=$(EXTPROC32) $(REDEFINES32)
@@ -950,11 +962,17 @@
$(RMF) $@
$(HSDEPXA_LINKLINE)
+# 2017/03/20
+# $(HSOTS) : $(ALWAYS) $(HSOTS_DEPS)
+# $(SILENT)$(ECHO)
+# $(SILENT)$(ECHO) " - Linking HS OTS agent"
+# $(RMF) $@
+# $(HSOTS_LINKLINE)
$(HSOTS) : $(ALWAYS) $(HSOTS_DEPS)
$(SILENT)$(ECHO)
$(SILENT)$(ECHO) " - Linking HS OTS agent"
$(RMF) $@
- $(HSOTS_LINKLINE)
+ $(HSOTS_LINKLINE) -lagtsh
$(HSODBC) : $(ALWAYS) $(HSODBC_DEPS)
$(SILENT)$(ECHO)
5.リスナとデータベース作成の前準備
$HOME/.profile に以下の行を追記
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export NLS_LANG=JAPANESE_JAPAN.UTF8
6.リスナの作成
$ vi `which netca`
===========================================================
diff bin.org/netca bin/netca
95c95,96
< JRE_DIR=/u01/app/oracle/product/12.1.0/dbhome_1/jdk/jre
---
> #JRE_DIR=/u01/app/oracle/product/12.1.0/dbhome_1/jdk/jre
> JRE_DIR=/usr/lib/jvm/default-java
===========================================================
$ netca
※リスナー作成時のメニュー選択は1521ポートを使用するのであれば全てリターンで作成可
7.データベースの作成
$ vi `which dbca`
===========================================================
diff bin.org/dbca bin/dbca
70c70,71
< JRE_DIR=/u01/app/oracle/product/12.1.0/dbhome_1/jdk/jre
---
> #JRE_DIR=/u01/app/oracle/product/12.1.0/dbhome_1/jdk/jre
> JRE_DIR=/usr/lib/jvm/default-java
===========================================================
$ dbca
8.データベース、リスナの起動、終了
※作成中
9.オラクルクライアントのインストール
※
「ubuntu に oracle client をインストール」を参照
10.プログラムからのデータベース接続
0 件のコメント:
コメントを投稿