(筆記)Pro Oracle Database 12c Administration Second Edition

oratab文件生成環境變量? P27 2.1.3

Pro Oracle Database 12c Administration 中有利用 /etc/oratab 生成oracle 環境變量的例子。
實踐之後發現,/etc/oratab 是由run.sh生成,而件初始值爲空。只有手動添加或者dbca建庫時纔會向其中添加條目。從run.sh生成的log中可以看到這點。

Running Oracle 11g root.sh script…

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1

Creating /etc/oratab file…
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

因此書中oraset.sh腳本使用有限制:
1. 選擇dbca建庫後執行oraset.sh
2. 手動添加條目後執行oraset.sh
這種通過解析 oratab 文件生成環境變量的方法,將 export 隱藏在 oraset 腳本中,個人認爲可讀性不好,但是減少了手動添加帶來的風險。特別是存在多個數據庫且需要在某個時刻選擇其中一個的時候。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章