AIX7上挂在linux的共享文件夹

目的是备份数据库;又没与多余的硬盘空间,想挂载LINUX下的NFS 来实现

环境:

  1. linux系统,192.168.8.200用来做备份;
  2. AIX7.01  192.168.8.250 数据库环境。

操作Linux:

  1. 检测linxu环境是否安装了NFS;
rpm -ivh nfs4-acl-tools-0.3.3-3.el5.x86_64.rpm
rpm -ivh nfs-utils-lib-devel-1.0.8-7.9.el5.x86_64.rpm

  2.新建一个文件夹,用过备份:

mkdir /data/dbbak

  3.配置/etc/exports

vi /etc/exports
#添加以下配置:
/data/dbbak/   192.168.8.250(rw,no_root_squash)
#192.168.8.250是AIX服务器IP

  4.重启NFS服务

systemctl  restart nfs
systemctl restart portmap #或者使用service nfs restart
#service portmap restart 

 由于NFS服务是基于portmap服务的,所以我们需要先启动portmap服务:service portmap restart ,然后 service nfs restart  使用showmount 指令看看是否共享成功showmount -e  后面跟你的服务器IP

  5.查看mount

[root@Linux ~]# showmount -e 192.168.8.200
Export list for 192.168.8.200:
/data/dbbak 192.168.8.250
#以上显示表示正常

操作AIX:

  1. mount文件夹

mount 192.168.8.200:/data/dbbak  /dbbak

  默认情况,AIX系统执行mount命令请求时并不使用预先定义好的端口,设置nfs_use_reserved_ports后可使用1024以下的预定义端口。

root@AIX:/# nfso -a | grep nfs_use_reserved_ports
      nfs_use_reserved_ports = 0
root@AIX:/# nfso -o nfs_use_reserved_ports=1
Setting nfs_use_reserved_ports to 1

root@AIX:/# nfso -a | grep nfs_use_reserved_ports
      nfs_use_reserved_ports = 1
 mount -v nfs -o rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp 192.168.8.200:/data/dbbak   /dbbak

    #这样AIX 就可以正确挂载Linux 的nfs 共享文件了 

2、直接在/etc/filesystems后面有添加如下内容,或者使用smitty nfs:

/dbbak:
        dev             = /data/dbbak
        vfs             = nfs
        nodename        = 192.168.8.200
        mount           = true
        options         =  rw,bg,hard,nointr,rsize=32768,wsize=32768,proto=tcp,vers=3,timeo=600
        account         = false

 测试:

  1.使用df -g 查看

  

Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           1.00      0.72   29%    10536     6% /
/dev/hd2          10.00      4.76   53%    57667     5% /usr
/dev/hd9var       10.00      5.54   45%     6506     1% /var
/dev/hd3          20.00     12.85   36%     4619     1% /tmp
/dev/fwdump        1.00      1.00    1%        4     1% /var/adm/ras/platform
/dev/hd1          10.00      9.97    1%      112     1% /home
/dev/hd11admin      0.50      0.50    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt       2.00      1.64   18%     9805     3% /opt
/dev/livedump      0.50      0.50    1%        4     1% /var/adm/ras/livedump
/dev/lvusrsap     35.00     17.02   52%    70973     2% /usr/sap
/dev/lvsapmnt     20.00     17.19   15%    32989     1% /sapmnt
/dev/lvoracle    940.00    410.21   57%    62862     1% /oracle
sapecd01:/usr/sap/trans    100.00     84.80   16%    56449     1% /usr/sap/trans
192.168.8.200:/dbbackup/sapbak   2824.17   2578.46    9%   210436     1% /dbbak
# mount
  node       mounted        mounted over    vfs       date        options      
-------- ---------------  ---------------  ------ ------------ --------------- 
         /dev/hd4         /                jfs2   Dec 31 09:05 rw,log=/dev/hd8 
         /dev/hd2         /usr             jfs2   Dec 31 09:05 rw,log=/dev/hd8 
         /dev/hd9var      /var             jfs2   Dec 31 09:05 rw,log=/dev/hd8 
         /dev/hd3         /tmp             jfs2   Dec 31 09:05 rw,log=/dev/hd8 
         /dev/fwdump      /var/adm/ras/platform jfs2   Dec 31 09:07 rw,log=/dev/hd8 
         /dev/hd1         /home            jfs2   Dec 31 09:08 rw,log=/dev/hd8 
         /dev/hd11admin   /admin           jfs2   Dec 31 09:08 rw,log=/dev/hd8 
         /proc            /proc            procfs Dec 31 09:08 rw              
         /dev/hd10opt     /opt             jfs2   Dec 31 09:08 rw,log=/dev/hd8 
         /dev/livedump    /var/adm/ras/livedump jfs2   Dec 31 09:08 rw,log=/dev/hd8 
         /dev/lvusrsap    /usr/sap         jfs2   Dec 31 09:08 rw,log=/dev/loglv00
         /dev/lvsapmnt    /sapmnt          jfs2   Dec 31 09:08 rw,log=/dev/loglv00
         /dev/lvoracle    /oracle          jfs2   Dec 31 09:08 rw,log=/dev/loglv00
sapecd01 /usr/sap/trans   /usr/sap/trans   nfs3   Dec 31 09:08 bg,hard,intr,sec=sys,rw
192.168.8.200 /data/dbbak /dbbak           nfs3   Dec 30 15:55 rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp

 

测试数据库:

oracle@ptdb1:/rmanbak$expdp system/oracle directory=mypump dumpfile=expxiaobi.dmp log=expxiaobi.log schemas=xiaobi

Export: Release 11.2.0.3.0 - Production on Wed Aug 6 15:22:03 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Legacy Mode Active due to the following parameters:
Legacy Mode Parameter: "log=expxiaobi.log" Location: Command Line, Replaced with: "logfile=expxiaobi.log"
Legacy Mode has set reuse_dumpfiles=true parameter.
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** directory=mypump dumpfile=expxiaobi.dmp logfile=expxiaobi.log schemas=xiaobi reuse_dumpfiles=true
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 30 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . exported "XIAOBI"."TEST"                             8.253 MB   85644 rows
. . exported "XIAOBI"."TEST2"                            8.253 MB   85645 rows
. . exported "XIAOBI"."TEST3"                            8.253 MB   85646 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /rmanbak/expxiaobi.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 15:23:01
oracle@ptdb1:/rmanbak$impdp system/oracle directory=mypump dumpfile=expxiaobi.dmp  log=impxiaobi.log remap_schema=xiaobi:xiahao

Import: Release 11.2.0.3.0 - Production on Wed Aug 6 15:28:57 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Legacy Mode Active due to the following parameters:
Legacy Mode Parameter: "log=impxiaobi.log" Location: Command Line, Replaced with: "logfile=impxiaobi.log"
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** directory=mypump dumpfile=expxiaobi.dmp logfile=impxiaobi.log remap_schema=xiaobi:xiahao   
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"XIAHAO" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "XIAHAO"."TEST"                             8.253 MB   85644 rows
. . imported "XIAHAO"."TEST2"                            8.253 MB   85645 rows
. . imported "XIAHAO"."TEST3"                            8.253 MB   85646 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 1 error(s) at 15:29:09

oracle@ptdb1:/rmanbak$
oracle@ptdb1:/rmanbak$exit

15:29:26 sys@PORTALDB> conn xiahao/xiahao123
Connected.
15:29:34 xiahao@PORTALDB> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
TEST                           TABLE
TEST2                          TABLE
TEST3                          TABLE


使用RMAN测试 也是正常的;


RMAN> backup tablespace xiahao format '/rmanbak/%U';

Starting backup at 06-AUG-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=+ORADATA/portaldb/datafile/xiahao.283.834596721
input datafile file number=00007 name=+ORADATA/portaldb/datafile/xiahao.284.834596877
channel ORA_DISK_1: starting piece 1 at 06-AUG-14
channel ORA_DISK_1: finished piece 1 at 06-AUG-14
piece handle=/rmanbak/0jpf9ctb_1_1 tag=TAG20140806T153259 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-AUG-14

Starting Control File and SPFILE Autobackup at 06-AUG-14
piece handle=/oracle/product/11.2.0/dbs/c-663718102-20140806-00 comment=NONE
Finished Control File and SPFILE Autobackup at 06-AUG-14

 

 

  

posted @ 2020-12-30 16:20  ITer的运维人生  阅读(520)  评论(0编辑  收藏  举报