20170719-Oracle DNFS

在这里插入图片描述

说明:

本文整理自我的ITPUB博客,链接如下:

https://blog.itpub.net/29785807/viewspace-2142283/

实验说明:

服务器一:TEST1( NFS服务端)
服务器二:TEST2( NFS客户端)

其中:

NFS服务端将 /vol/oradata目录设置为共享目录;
NFS客户端上的数据库orcl使用共享目录/vol/oradata,并在共享目录里创建表空间,生成的数据文件自动保存在TES1(NFS服务端)机器上;

(1)检查NFS服务端nfs和portmap服务正常启动
TEST1(NFS服务端):

[root@TEST1 ~]# /etc/init.d/nfs status
rpc.mountd (pid 4123) is running...
nfsd (pid 4120 4119 4118 4117 4116 4115 4114 4113) is running...
rpc.rquotad (pid 4091) is running...
[root@TEST1 ~]# /etc/init.d/portmap status
portmap (pid 3585) is running...

(2)配置exports文件,共享/vol/oradata目录

[root@TEST1 ~]# cat /etc/exports 
/vol/oradata *(rw,sync,no_wdelay,insecure,insecure_locks,no_root_squash)

(3)NFS客户端通过mount命令将共享目录/vol/oradata挂载到/u02/oradata/prod1目录
TEST2(NFS客户端):

[root@TEST2 ~]# mount -o remount /vol/oradata /u02/oradata/prod1
[root@TEST2 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              15G  6.0G  7.9G  44% /
/dev/sda2              30G  8.6G   20G  31% /u01
/dev/sda1              99M   29M   65M  31% /boot
tmpfs                 1.5G  540M  982M  36% /dev/shm
TEST1.example.com:/vol/oradata
                      433G   30G  381G   8% /u02/oradata/prod1

(4)TEST2(NFS客户端)配置DNFS

[root@TEST2 ~]# vi /etc/oranfstab
server:server
path:TEST1.example.com
local:TEST2.example.com
export:/vol/oradata mount:/u02/oradata/prod1

(5)TEST2(NFS客户端)启用DNFS客户端

[oracle@TEST2 ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/
[oracle@TEST2 lib]$ make -f ins_rdbms.mk dnfs_on
rm -f /u01/app/oracle/product/11.2.0/dbhome_1/lib/libodm11.so; cp /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnfsodm11.so /u01/app/oracle/product/11.2.0/dbhome_1/lib/libodm11.so

(6)TEST2(NFS客户端)在共享目录下创建表空间test_tbs;

SQL> create tablespace test_tbs datafile '/u02/oradata/prod1/test_tbs01.dbf' size 10M;
Tablespace created.

(7) 验证
如果在TEST2客户端/u02/oradata/prod1目录创建的数据文件自动生成在TEST1服务端/vol/oradata目录下,说明DNFS成功;
TES1服务端查看文件

[root@TEST1 ~]# ll -rth /vol/oradata/test_tbs01.dbf 
-rw-r----- 1 oracle oinstall 11M Jul 19 12:40 /vol/oradata/test_tbs01.dbf

TEST2客户端查看文件

[oracle@TEST2 lib]$ ll -rth /u02/oradata/prod1/test_tbs01.dbf 
-rw-r----- 1 oracle oinstall 11M Jul 19 12:40 /u02/oradata/prod1/test_tbs01.dbf

查看以下动态性能视图
如果结果为空,需要重启数据库实例;

SQL> set linesize 200
SQL> col filename for a50
SQL> select * from v$dnfs_files;
FILENAME                                             FILESIZE       PNUM     SVR_ID
-------------------------------------------------- ---------- ---------- ----------
/u02/oradata/prod1/test_tbs01.dbf                    10493952         10          1

SQL> col svrname for a20
SQL> col dirname for a20
SQL> select * from v$dnfs_servers;
        ID SVRNAME              DIRNAME                 MNTPORT    NFSPORT      WTMAX      RTMAX
---------- -------------------- -------------------- ---------- ---------- ---------- ----------
         1 server               /vol/oradata                963       2049      32768      32768

关于DNFS更详细的内容,参见官方文档,链接如下:

http://docs.oracle.com/cd/E11882_01/install.112/e47689/post_inst_task.htm#LADBI1297
http://docs.oracle.com/cd/E11882_01/install.112/e41961/storage.htm#CWLIN279
一:Enabling a Direct NFS Client
By default Direct NFS Client serves mount entries found in /etc/mtab. 
No other configuration is required. 
You can use oranfstab to specify additional Oracle Database specific options to Direct NFS Client. 
For example, you can use oranfstab to specify additional paths for a mount point.

A new Oracle Database specific file oranfstab can be added to either /etc or to $ORACLE_HOME/dbs. 
When oranfstab is placed in $ORACLE_HOME/dbs, its entries are specific to a single database. 
However, when oranfstab is placed in /etc, then it is global to all Oracle databases, and hence can contain mount points for all Oracle databases.

Note:
Direct NFS Client does not work and falls back to the traditional kernel NFS path if the back-end NFS server does not support a write size (wtmax) of 32768 or larger.

Direct NFS Client determines mount point settings to NFS storage devices based on the configurations in /etc/mtab. Direct NFS Client looks for the mount point entries in the following order:
(1) $ORACLE_HOME/dbs/oranfstab
(2) /etc/oranfstab
(3) /etc/mtab
It uses the first matched entry as the mount point.

Oracle Database requires that mount points be mounted by the kernel NFS system even when served through Direct NFS Client.

Complete the following procedure to enable Direct NFS Client:
1.You can optionally create an oranfstab file with the following attributes for each NFS server to be accessed using Direct NFS Client:

(1)Server: 
The NFS server name.
(2)Path: 
Up to four network paths to the NFS server, specified either by IP address, or by name, as displayed using the ifconfig command on the filer.
(3)Local: 
Up to four local paths on the database host, specified by IP address or by name, as displayed using the ifconfig command run on the database host.
(4)Export: 
The exported path from the NFS server.
(5)Mount: 
The corresponding local mount point for the exported volume.
(6)Dontroute: 
Specifies that outgoing messages should not be routed by the operating system, but sent using the IP address they are bound to. 
Please note that this attribute does not work on Linux with multiple paths in the same subnet.
(7)mnt_timeout: 
Specifies (in seconds) the time for which Direct NFS Client should wait for a successful mount before timing out. 
This parameter is optional and the default timeout is 10 minutes.
(8)management: 
Enables Direct NFS Client to use the management interface for SNMP queries. 
You can use this parameter if SNMP is running on separate management interfaces on the NFS server. 
The default value is the server parameter value.
(9)community: 
Specifies the community string for use in SNMP queries. The default value is public.

Example 3-1 Using Local and Path NFS Server Entries

The following example uses both local and path. Since they are in different subnets, we do not have to specify dontroute.

server: MyDataServer1
local: 192.0.2.0
path: 192.0.2.1
local: 192.0.100.0
path: 192.0.100.1
export: /vol/oradata1 mount: /mnt/oradata1
community: private

Example 3-2 Using Local and Path in the Same Subnet, with dontroute

The following example shows local and path in the same subnet. dontroute is specified in this case:

server: MyDataServer2
local: 192.0.2.0
path: 192.0.2.128
local: 192.0.2.1
path: 192.0.2.129
dontroute
export: /vol/oradata2 mount: /mnt/oradata2
management: 192.0.10.128

Example 3-3 Using Names in Place of IP Addresses, with Multiple Exports

server: MyDataServer3
local: LocalPath1
path: NfsPath1
local: LocalPath2
path: NfsPath2
local: LocalPath3
path: NfsPath3
local: LocalPath4
path: NfsPath4
dontroute
export: /vol/oradata3 mount: /mnt/oradata3
export: /vol/oradata4 mount: /mnt/oradata4
export: /vol/oradata5 mount: /mnt/oradata5
export: /vol/oradata6 mount: /mnt/oradata6

By default, Direct NFS Client is installed in a disabled state. To enable Direct NFS Client, complete the following steps on each node. If you use a shared Grid home for the cluster, then complete the following steps in the shared Grid home:

Log in as the Oracle Grid Infrastructure installation owner.
Change directory to Grid_home/rdbms/lib.
Enter the following commands:
$ make -f ins_rdbms.mk dnfs_on

二: Disabling Direct NFS Client
Complete the following steps to disable the Direct NFS Client:

Log in as the Oracle software installation owner, and disable Direct NFS Client using the following commands:

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dnfs_off
Remove the oranfstab file.

Note:
If you remove an NFS path that Oracle Database is using, then you must restart the database for the change to take effect.

欢迎关注我的微信公众号"IT小Chen"

### 机器学习与DNFSDNFSA的区别和联系 #### DNFS概述 Direct NFS (DNFS) 是Oracle数据库的一项特性,允许Oracle直接通过NFS协议访问文件系统中的数据文件,而不必经过操作系统级别的缓存机制[^1]。这种方式能够减少I/O延迟并提升性能。 #### DNFSA概念澄清 需要注意的是,在提供的引用材料中并未提及名为“DNFSA”的具体技术名称。假设这里指的是某种扩展或者变体形式,则可能是指特定环境下的配置优化或者是误写。通常讨论的都是DNFS本身及其应用情境。 #### 机器学习基础介绍 机器学习涉及构建模型来解析数据、从中学习规律,并基于这些学到的知识做出决策或预测。例如,在医疗领域内可以通过调整阈值以平衡查准率(Precision) 和 查全率(Recall),从而更好地处理二分类问题,如判断肿瘤性质良恶性的案例所示[^5]。 #### 区别分析 - **应用场景差异** - **DNFS**: 主要应用于存储管理和数据库操作层面,旨在改善磁盘读写的效率以及降低网络传输带来的开销。 - **机器学习**: 属于数据分析范畴的技术手段之一,用于挖掘隐藏模式、趋势或是辅助自动化流程等高级功能实现。 - **工作原理区别** - **DNFS** 的核心在于绕过传统OS层面对NFS请求的管理方式,提供更高效的路径直达目标资源位置。 - **机器学习** 则依赖统计学理论框架下的一系列算法来进行训练过程,进而形成具有泛化能力的学习器实例。 #### 联系探讨 尽管两者属于完全不同的技术和学科分支,但在实际的企业级信息系统架构里可能会存在间接关联: - 当部署大规模分布式计算平台时,为了支持高效的数据交换需求,常常会采用高性能的存储解决方案,此时就涉及到如何利用好诸如DNFS这样的工具来保障底层设施的服务质量; - 对于某些需要实时性强且吞吐量大的AI服务而言,确保其背后支撑体系具备良好的IO表现至关重要;因此合理设置包括但不限于启用DNFS在内的各项参数有助于维持整个系统的稳定性和响应速度。 ```python # Python伪代码展示简单的机器学习模型评估指标计算逻辑 def calculate_f1_score(precision, recall): f1 = 2 * ((precision * recall) / (precision + recall)) return f1 ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值