Optimal Flexible Architecture
完全实现OFA至少需要三个文件系统位于不同的物理设备上,这些物理设备本身没有做条带或镜像。如果这些物理设备要做冗余与吞吐,建议使用一些存储相关的概念与东西,例如:lvm,raid,asm之类的存储技术手段来保障。
OMF oracle-managed files 即oracle_base/oradata
OFA帮助识别oracle_base及其ADR诊断数据
ORACLE_BASE /u01/app/oracle 有下面内容的就是ORACLE_BASE目录
[root@oracle3A oracle3A]# ls
admin cfgtoollogs checkpoints diag flash_recovery_area oradata product
Automatic Diagnostic Repository 就是上面的diag目录
OFA 推荐的命名策略:包括5部分
1.文件系统 挂载点数量与命名 /pm 即/u01,/u02,/u03或/disk01,/disk02,/disk03之类
2.数据库目录命名
3.数据库文件命名
4.根据不同的需求分段
5.为oracle文件开发OFA结构
以下是目录命名,包括4部分:base,vldb,home,子目录
1.oracle base /pm/s/u 例如:/u01/app/oracle,/u01/app/applmgr
[root@oracle3A oracle3A]# ls
admin cfgtoollogs checkpoints diag flash_recovery_area oradata product
[root@oracle3A oracle3A]# pwd
/oracle3A
其中admin是管理文件目录
oradata是数据文件目录
product是home目录
diag是adr目录
2.VLDB /h/q/d 例如:对test库分配两个专用盘的挂载点,/u01/app/oracle/oradata/test和/u02/app/oracle/oradata/test
3.oracle home /pm/s/u/product/v/type_[n] 例如:/u01/app/oracle/product/11.2.0/dbhome_1
4.子目录
/h/admin/d/a
数据库管理文件子目录 例如:10g
[root@flt flt]# ls
adump bdump cdump dpdump pfile udump
[root@flt flt]# pwd
/oracle/admin/flt 例如:11g
[root@oracle3A flt]# ls
adump dpdump pfile scripts
[root@oracle3A flt]# pwd
/oracle3A/admin/flt 在11g中,ADR目录替换了bdump,cdump,udump
/h/diag/rdbms/d/i/
ADR目录
[root@oracle3A flt]# pwd
/oracle3A/diag/rdbms/flt/flt
[root@oracle3A flt]# ls
alert cdump hm incident incpkg ir lck metadata stage sweep trace
oradata目录
包括控制文件,重做日志文件,表空间文件
Control files /h/q/d/control.ctl
Redo log files /h/q/d/redon.log
Data files /h/q/d/tn.dbf 例如:
[root@localhost orcl]# pwd
/u01/app/oracle/oradata/orcl
[root@localhost orcl]# ll
total 1513460
-rw-r-----. 1 oracle oinstall 9748480 Jul 10 11:56 control01.ctl
-rw-r-----. 1 oracle oinstall 52429312 Jul 10 11:56 redo01.log
-rw-r-----. 1 oracle oinstall 52429312 Jul 10 02:00 redo02.log
-rw-r-----. 1 oracle oinstall 52429312 Jul 10 10:01 redo03.log
-rw-r-----. 1 oracle oinstall 566239232 Jul 10 11:55 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 713039872 Jul 10 11:52 system01.dbf
-rw-r-----. 1 oracle oinstall 30416896 Jul 10 11:53 temp01.dbf
-rw-r-----. 1 oracle oinstall 94380032 Jul 10 11:53 undotbs01.dbf
-rw-r-----. 1 oracle oinstall 5251072 Jul 10 10:06 users01.dbf
oraInventory目录
在安装oracle软件或者使用dbca创建数据库时,所有的日志都会放在oraInventory这个目录下。
默认情况下该目录会在$ORACLE_BASE/oraInventory下,但是我们也可以通过更改/etc/oraInst.loc文件来指定具体的路径:
在linux下:
该文件路径为/etc/oraInst.loc
在hpunix下:
该文件路径为 /var/opt/oracle/oraInst.loc You all might be familiar with oraInventory & its importance so lets take a look at few common things about it like binary/xml inventory, What to do if Inventory is corrupted , What is global / Local Inventory and where to find documentation related to oraInventory . What is oraInventory ?
oraInventory is repository (directory) which store/records oracle software products & their oracle_homes location on a machine.
This Inventory now a days in XML format and called as XML Inventory where as in past it used to be in binary format & called as binary Inventory.
There are basically two kind of Inventory Global Inventory (also called as Central Inventory) and Local Inventory also called as Oracle Home Inventory. Global Inventory ?
Global Inventory holds information about Oracle Products on a Machine. These products can be various oracle components like database, oracle application server, collaboration suite, soa suite, forms & reports or discoverer server.
This global Inventory location will be determined by file oraInst.loc in /etc (on Linux) or /var/opt/oracle (solaris).
If you want to see list of oracle products on machine check for file inventory.xml under ContentsXML in oraInventory.
Please note if you have multiple global Inventory on machine check all oraInventory directories) You will see entry like
HOME NAME=”ORA10g_HOME” LOC=”/u01/oracle/10.2.0/db” TYPE=”O” IDX=”1″/
…
… Local Inventory
Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This Inventory holds information to that oracle_home only. Can I have multiple Global Inventory on a machine ?
Quite common questions is that can you have multiple global Inventory and answer is YES you can have multiple global Inventory but if your upgrading or applying patch then change Inventory Pointer oraInst.loc to respective location.
If you are following single global Inventory and if you wish to uninstall any software then remove it from Global Inventory as well. What to do if my Global Inventory is corrupted ?
No need to worry if your global Inventory is corrupted, you can recreate global Inventory on machine using
Universal Installer and attach already Installed oracle home by option
-attachHome ./runInstaller -silent -attachHome -invPtrLoc $location_to_oraInst.loc
ORACLE_HOME=”Oracle_Home_Location” ORACLE_HOME_NAME=”Oracle_Home_Name”
CLUSTER_NODES=”{}” Do I need to worry about oraInventory during oracle Apps 11i cloning ?
No, Rapid Clone will update both Global & Local Inventory with required information , you don’t have to worry about Inventory during Oracle Apps 11i cloning.
$ORACLE_HOME目录下重要子目录
$ORACLE_HOME/dbs
包括参数文件,11.2.0.4,一个库4个文件(密码,spfile,hc,lk),init.ora始终是一个
[root@localhost ~]# cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
[root@localhost dbs]# ls
hc_orcl.dat init.ora lkORCL orapworcl spfileorcl.ora
[oracle@db dbs]$ ll
total 36
-rw-rw----. 1 oracle oinstall 1544 Oct 10 15:29 hc_orcl.dat
-rw-rw----. 1 oracle oinstall 1544 Oct 21 23:23 hc_wode.dat
-rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora
-rw-r-----. 1 oracle oinstall 24 Oct 10 15:27 lkORCL
-rw-r-----. 1 oracle oinstall 24 Oct 17 20:31 lkWODE
-rw-r-----. 1 oracle oinstall 1536 Oct 10 15:29 orapworcl
-rw-r-----. 1 oracle oinstall 1536 Oct 17 20:53 orapwwode
-rw-r-----. 1 oracle oinstall 2560 Oct 19 15:35 spfileorcl.ora
-rw-r-----. 1 oracle oinstall 2560 Oct 21 21:22 spfilewode.ora
[oracle@db dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
在$ORACLE_HOME/dbs下存在lk打頭的文件,文件内容很簡單,到底這個文件是做什麽用的呢?
[oracle@Channel-MQ3 dbs]$ cat lkTESTDB
DO NOT DELETE THIS FILE!
这是个MOUNT 锁文件 [6 Metalink, 2000] 。这会阻止两个实例 mount 在同一数据库上,当不使用并行服务器的模式下,要使用不同的 ORACLE_SID 。原来这是个 0 长度文件,不过现在包含文本 'DO NOT DELETE THIS FILE!' 。
$ORACLE_HOME/rdbms
数据字典目录,全是sql文件与plb文件
/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin
错误消息提示信息存放的地点,msg与msb文件
/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/mesg
$ORACLE_HOME/network
网络相关目录及文件
[oracle@db admin]$ ls
listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
[oracle@db admin]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin
$ORACLE_HOME/sqldeveloper