在一个硬盘设备上建立xfs,并增加一个logfile member

创建xfs文件系统

[root@localhost ~]# fdisk /dev/sdp
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x14650e5b.

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-62914559, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559): 
Using default value 62914559
Partition 1 of type Linux and of size 30 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# mkfs.xfs /dev/sdp1
specified blocksize 4096 is less than device physical sector size 8192
switching to logical sector size 512
meta-data=/dev/sdp1              isize=512    agcount=4, agsize=1966016 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=7864064, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=3839, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@localhost ~]# 
[root@localhost ~]# mkdir /zvol_redo
[root@localhost ~]# chown oracle. /zvol_redo
[root@localhost ~]#  mount -t xfs /dev/sdp1 /zvol_redo
[root@localhost ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 126G     0  126G   0% /dev
tmpfs                    126G  7.3G  119G   6% /dev/shm
tmpfs                    126G   27M  126G   1% /run
tmpfs                    126G     0  126G   0% /sys/fs/cgroup
/dev/mapper/centos-root   50G  6.3G   44G  13% /
/dev/md0                  13T   12T  1.7T  88% /u01
/dev/sda1               1014M  151M  864M  15% /boot
/dev/mapper/centos-home   56G   16G   41G  28% /home
tmpfs                     26G     0   26G   0% /run/user/1000
/dev/sdi1                 59G  300M   59G   1% /mnt/fc_disk/fc-0x21000024FF2091C0-lun-4
/dev/sdj1                 10T  2.3T  7.8T  23% /mnt/fc_disk/fc-0x21000024FF2091C0-lun-5
/dev/sdo1                8.8T  8.3T  534G  95% /mnt/fc_disk/fc-0x21000024FF2091C0-lun-6
/dev/sdn1                6.8T  124M  6.8T   1% /mnt/fc_disk/fc-0x21000024FF2091C0-lun-9
tmpfs                     26G     0   26G   0% /run/user/54321
/dev/sdp1                 30G   33M   30G   1% /zvol_redo
[root@localhost ~]# 

想要启动时自动挂载XFS分区在/zvol_redo上,加入下列行到/etc/fstab:

/dev/sdp1 /zvol_redo xfs defaults 0 1

增加一个logfile 的member

alter database drop logfile member '/lvm_redo/redo22.log';
alter database drop logfile member '/lvm_redo/redo32.log';
alter system switch logfile;
alter database drop logfile member '/lvm_redo/redo12.log';
 alter database add logfile member '/zvol_redo/redo12.log' to group 1;

alter database add logfile member '/zvol_redo/redo22.log' to group 2;
alter database add logfile member '/zvol_redo/redo32.log' to group 3;
set linesize 200
col member form a30
select * from v$log;
select * from v$logfile;

[oracle@localhost ~]$ ll /zvol_redo/
total 6291468
-rw-r-----. 1 oracle oinstall 2147484160 8月  31 15:32 redo12.log
-rw-r-----. 1 oracle oinstall 2147484160 8月  31 15:32 redo22.log
-rw-r-----. 1 oracle oinstall 2147484160 8月  31 15:32 redo32.log
[oracle@localhost ~]$ 

姚远ACE CSDN认证博客专家 ACE 华为云 MVP
Oracle ACE,华为云 MVP,Oracle10g,12c OCM; MySQL 5.6,5.7,8.0 OCP;CCNA; EMC Certified; IBM P Certified; RHCE; SQLServer 764; DB2 Certified; TOEIC 890;获得过两次国家部级科技进步奖;发明过两项计算机专利。微信:yaoyuanace 邮箱:yaoyuanace(at)qq.com
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页