@clisdodo
2019-11-19T17:03:21.000000Z
字数 17517
阅读 3550
OEL7.7
19c
SingleInstance
ASM
AskScuti :搭建类 2-0-3 Oracle 19c 单实例ASM采用UDEV方式静默搭建
0级搭建类
1级搭建类
磁盘 | 容量 | 作用 |
---|---|---|
/dev/sdb | 32.2 GB | Oracle Software |
/dev/sdc | 1073 MB | OCR1 |
/dev/sdd | 1073 MB | OCR2 |
/dev/sde | 1073 MB | OCR3 |
/dev/sdf | 214.7 GB | Data1 |
/dev/sdg | 214.7 GB | Data2 |
/dev/sdh | 107.4 GB | Archived |
/dev/sdi | 536.9 GB | Backup |
最终磁盘分区格式呈现如下
[root@asmsi19c ~]# ls /dev/sd*1 |grep -v sda1
/dev/sdb1
/dev/sdc1
/dev/sdd1
/dev/sde1
/dev/sdf1
/dev/sdg1
/dev/sdh1
/dev/sdi1
格式化分区并创建文件系统(仅 /dev/sdb1),其他分区用于ASM存储
[root@asmsi19c ~]# mkdir /u01
[root@asmsi19c ~]# mount /dev/sdb1 /u01/
[root@asmsi19c ~]# blkid /dev/sdb1
/dev/sdb1: UUID="d2faa108-6c80-4ba7-81f1-3053f91a5dd9" TYPE="xfs"
[root@asmsi19c ~]# vim /etc/fstab
/*** 编辑文件,添加以下行
UUID=d2faa108-6c80-4ba7-81f1-3053f91a5dd9 /u01 xfs defaults 0 0
***/
[root@asmsi19c ~]# mount -a
[root@asmsi19c ~]# df -Th
主机名及IP
echo "192.168.1.19 asmsi19c" >> /etc/hosts
用户和组
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 asmadmin
/usr/sbin/groupadd -g 54325 asmoper
/usr/sbin/groupadd -g 54326 asmdba
/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
passwd oracle --> Changing password for user oracle.
passwd grid --> Changing password for user grid.
文件夹及权限
mkdir -p /u01/app/grid
mkdir -p /u01/app/19.3.0/grid
mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/19.3.0
chmod -R 775 /u01/
RPM 包
mv /etc/yum.repos.d/* /tmp/
echo "[local_yum]" >> /etc/yum.repos.d/henry.repo
echo "name = henry_repo" >> /etc/yum.repos.d/henry.repo
echo "baseurl = file:///mnt/" >> /etc/yum.repos.d/henry.repo
echo "enabled = 1" >> /etc/yum.repos.d/henry.repo
echo "gpgcheck = 0" >> /etc/yum.repos.d/henry.repo
mount /dev/cdrom /mnt/
yum -y install autoconf
yum -y install automake
yum -y install binutils
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-libcap1
yum -y install compat-libstdc++-33
yum -y install compat-libstdc++-33.i686
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXext
yum -y install libXext.i686
yum -y install libXtst
yum -y install libXtst.i686
yum -y install libX11
yum -y install libX11.i686
yum -y install libXau
yum -y install libXau.i686
yum -y install libxcb
yum -y install libxcb.i686
yum -y install libXi
yum -y install libXi.i686
yum -y install libstdc++.i686
yum -y install libstdc++-devel
yum -y install libstdc++-devel.i686
yum -y install libaio
yum -y install libaio.i686
yum -y install libaio-devel
yum -y install libaio-devel.i686
yum -y install ksh
yum -y install libXp
yum -y install libaio-devel
yum -y install numactl
yum -y install numactl-devel
yum -y install make -y
yum -y install sysstat -y
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install elfutils-libelf-devel
yum -y install redhat-lsb-core
yum -y install unzip
yum -y install libXrender
yum -y install libXrender-devel
yum -y install nfs-utils
yum -y install smartmontools
yum -y install tigervnc
资源限制
vim /etc/security/limits.conf
# 编辑文件添加以下内容
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
内核参数
vim /etc/sysctl.conf
# 编辑文件添加以下内容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
kernel.panic_on_oops = 1
kernel.shmmax = 7730941132
kernel.shmall = 1887436
kernel.shmmni = 4096
# 执行命令刷新生效
sysctl -p
SHELL资源限制
echo "session required pam_limits.so" >> /etc/pam.d/login
防火墙
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
SELINUX
vim /etc/selinux/config
SELINUX=disabled
Oracle环境变量
su - oracle
vim .bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export TMPDIR=$TMP
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=SIASM19C; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19.3.0/dbhome_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
su - grid
vim .bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export TMPDIR=$TMP
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/19.3.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
[root@asmsi19c ~]# echo "options=-g" > /etc/scsi_id.config
/usr/lib/udev/scsi_id -g -u -d 分区名
确认标识符,最终对应关系如下分区 | SCSI标识符 |
---|---|
/usr/lib/udev/scsi_id -g -u -d /dev/sdc1 | 36000c2976a776add818a93264891b590 |
/usr/lib/udev/scsi_id -g -u -d /dev/sdd1 | 36000c29312aa0a9406f202760c690e9d |
/usr/lib/udev/scsi_id -g -u -d /dev/sde1 | 36000c29e98d5ab3b8fe9cc4bba81f723 |
/usr/lib/udev/scsi_id -g -u -d /dev/sdf1 | 36000c299f75c2fea6123eede18dc7f3b |
/usr/lib/udev/scsi_id -g -u -d /dev/sdg1 | 36000c29de5af3331b80aac9bfc85e7aa |
/usr/lib/udev/scsi_id -g -u -d /dev/sdh1 | 36000c298de4210b35dfe718a1e146866 |
/usr/lib/udev/scsi_id -g -u -d /dev/sdi1 | 36000c29c7f5fa636f0b246b2e98789dd |
vim /etc/udev/rules.d/99-oracle-asmdevices.rules
,按以下格式编辑条目,替换 RESULT
对应的SCSI标识符
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c2976a776add818a93264891b590", SYMLINK+="oracleasm/asm-ocr1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29312aa0a9406f202760c690e9d", SYMLINK+="oracleasm/asm-ocr2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29e98d5ab3b8fe9cc4bba81f723", SYMLINK+="oracleasm/asm-ocr3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c299f75c2fea6123eede18dc7f3b", SYMLINK+="oracleasm/asm-data1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29de5af3331b80aac9bfc85e7aa", SYMLINK+="oracleasm/asm-data2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c298de4210b35dfe718a1e146866", SYMLINK+="oracleasm/asm-archived", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29c7f5fa636f0b246b2e98789dd", SYMLINK+="oracleasm/asm-backup", OWNER="grid", GROUP="asmadmin", MODE="0660"
执行 partprobe 识别
/sbin/partprobe /dev/sdc1
/sbin/partprobe /dev/sdd1
/sbin/partprobe /dev/sde1
/sbin/partprobe /dev/sdf1
/sbin/partprobe /dev/sdg1
/sbin/partprobe /dev/sdh1
/sbin/partprobe /dev/sdi1
重启UDEV服务
udevadm control --reload-rules
查看磁盘
请确保所有链接磁盘均可见,并具有对应的正确权限,否则,在进行下一步之前请解决该问题。
[root@asmsi19c ~]# ls -lathr /dev/oracleasm/*
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-ocr1 -> ../sdc1
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-ocr3 -> ../sde1
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-data1 -> ../sdf1
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-ocr2 -> ../sdd1
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-data2 -> ../sdg1
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-archived -> ../sdh1
lrwxrwxrwx 1 root root 7 Nov 13 22:28 /dev/oracleasm/asm-backup -> ../sdi1
上面链接归 root 用户所有,但是链接所指向的磁盘是拥有正确权限的。
[root@asmsi19c ~]# ls -lathr /dev/sd*1 |grep -v sda1 |grep -v sdb1
brw-rw---- 1 grid asmadmin 8, 33 Nov 13 22:28 /dev/sdc1
brw-rw---- 1 grid asmadmin 8, 81 Nov 13 22:28 /dev/sdf1
brw-rw---- 1 grid asmadmin 8, 65 Nov 13 22:28 /dev/sde1
brw-rw---- 1 grid asmadmin 8, 49 Nov 13 22:28 /dev/sdd1
brw-rw---- 1 grid asmadmin 8, 97 Nov 13 22:28 /dev/sdg1
brw-rw---- 1 grid asmadmin 8, 113 Nov 13 22:28 /dev/sdh1
brw-rw---- 1 grid asmadmin 8, 129 Nov 13 22:28 /dev/sdi1
chown -R oracle:oinstall /soft
chmod -R 775 /soft
su - oracle
cd $ORACLE_HOME (注意oracle用户家目录:/u01/app/oracle/product/19.3.0/dbhome_1)
unzip -q /soft/19c-DB-V982063-01.zip
./runInstaller -ignorePrereq -waitforcompletion -silent \
-responseFile /u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oraInventory \
SELECTED_LANGUAGES=en,en_GB \
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSOPER_GROUP=oper \
oracle.install.db.OSBACKUPDBA_GROUP=dba \
oracle.install.db.OSDGDBA_GROUP=dba \
oracle.install.db.OSKMDBA_GROUP=dba \
oracle.install.db.OSRACDBA_GROUP=dba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true
su - root
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
su - oracle
cd $ORACLE_HOME
lsnrctl stop
netca -silent -responseFile /u01/app/oracle/product/19.3.0/dbhome_1/assistants/netca/netca.rsp
lsnrctl status
lsnrctl start
su - grid
cd $ORACLE_HOME (注意grid用户家目录:/u01/app/19.3.0/grid)
unzip -q /soft/19c-GI-V982068-01.zip
su - root
cd /u01/app/19.3.0/grid/cv/rpm/
chmod +x *
rpm -ivh cvuqdisk-1.0.10-1.rpm
su - grid
cd $ORACLE_HOME
./gridSetup.sh -ignorePrereq -waitforcompletion -silent \
-responseFile /u01/app/19.3.0/grid/install/response/gridsetup.rsp \
oracle.install.option=HA_CONFIG \
INVENTORY_LOCATION=/u01/app/oraInventory \
ORACLE_BASE=/u01/app/grid \
oracle.install.asm.storageOption=ASM \
oracle.install.asm.SYSASMPassword=oracle \
oracle.install.asm.monitorPassword=oracle \
oracle.install.asm.diskGroup.name=ocr \
oracle.install.asm.diskGroup.redundancy=NORMAL \
oracle.install.asm.diskGroup.AUSize=4 \
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracleasm/* \
oracle.install.asm.diskGroup.disks=/dev/oracleasm/asm-ocr1,/dev/oracleasm/asm-ocr2,/dev/oracleasm/asm-ocr3 \
oracle.install.asm.OSDBA=asmdba \
oracle.install.asm.OSOPER=asmoper \
oracle.install.asm.OSASM=asmadmin \
oracle.install.crs.config.gpnp.configureGNS=false \
oracle.install.crs.config.useIPMI=false \
oracle.install.asm.upgradeASM=false
# root 执行脚本(等待 root 用户执行完毕,再去执行 grid 脚本)
As a root user, execute the following script(s):
1. /u01/app/19.3.0/grid/root.sh
# grid 执行脚本(Attention! 执行这个脚本前,请先仔细阅读 6.2 小节:脚本补充说明)
As install user, execute the following command to complete the configuration.
/u01/app/19.3.0/grid/gridSetup.sh -executeConfigTools -responseFile /u01/app/19.3.0/grid/install/response/gridsetup.rsp [-silent]
从 Oracle 12cR2 版本开始,在安装 Oracle Grid Infrastructure 或 Oracle Database 软件后,系统会在 Grid 用户或 Oracle 用户对应的家目录中自动创建响应文件用于后期配置,具体可参考官方文档。以下为具体路径示例:
Oracle Grid Infrastructure(grid):$ORACLE_HOME/install/response/grid_2019-11-14_00-23-47AM.rsp
Oracle Database(oracle):$ORACLE_HOME/install/response/db_2019-11-13_11-03-32PM.rsp
在 6.1 小节中 grid 脚本执行方法
# 接 6.1 小节,当 root 脚本执行完毕后
su - grid
cd $ORACLE_HOME/install/response/
# 这里找到自动生成的文件,文件名格式:[product_timestamp.rsp] 例如:grid_2019-11-14_00-23-47AM.rsp
vim grid_2019-11-14_00-23-47AM.rsp
# 编辑该文件,对两个参数设置密码,保存
oracle.install.asm.SYSASMPassword=oracle
oracle.install.asm.monitorPassword=oracle
# grid 执行脚本
su - grid
cd $ORACLE_HOME
./gridSetup.sh -executeConfigTools -responseFile /u01/app/19.3.0/grid/install/response/grid_2019-11-14_00-23-47AM.rsp -silent
[grid@asmsi19c:/u01/app/19.3.0/grid]$crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE asmsi19c STABLE
ora.OCR.dg
ONLINE ONLINE asmsi19c STABLE
ora.asm
ONLINE ONLINE asmsi19c Started,STABLE
ora.ons
OFFLINE OFFLINE asmsi19c STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE asmsi19c STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE asmsi19c STABLE
--------------------------------------------------------------------------------
[grid@asmsi19c:/u01/app/19.3.0/grid]$lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-NOV-2019 08:21:34
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=asmsi19c)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 14-NOV-2019 00:43:45
Uptime 0 days 7 hr. 37 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.3.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/asmsi19c/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=asmsi19c)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_OCR" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
The command completed successfully
asmca
# 创建 ASM 磁盘组:DATA (/dev/oracleasm/asm-data1 | /dev/oracleasm/asm-data2)
asmca -silent -createDiskGroup \
-diskGroupName data \
-disk '/dev/oracleasm/asm-data1' \
-disk '/dev/oracleasm/asm-data2' \
-redundancy NORMAL \
-au_size 4 \
-compatible.asm '19.0.0.0.0' \
-compatible.rdbms '19.0.0.0.0' \
-compatible.advm '19.0.0.0.0'
# 创建 ASM 磁盘组:ARCHIVE (/dev/oracleasm/asm-archived)
asmca -silent -createDiskGroup \
-diskGroupName archive -disk '/dev/oracleasm/asm-archived' \
-redundancy EXTERNAL \
-au_size 4 \
-compatible.asm '19.0.0.0.0' \
-compatible.rdbms '19.0.0.0.0' \
-compatible.advm '19.0.0.0.0'
在 ASM 实例中,要以 sysasm
登录进行磁盘维护
[grid@asmsi19c:/home/grid]$sqlplus / as sysasm
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 14 08:45:16 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> set linesize 200
SQL> set linesize 200
SQL> col name for a15
SQL> col failgroup for a15
SQL> col path for a30
SQL> col group_number for 99
SQL> col disk_number for 99
# 查询当前 ASM 磁盘组
SQL> select group_number,name,type,total_mb,free_mb,usable_file_mb from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB USABLE_FILE_MB
------------ ---------- ------ ---------- ---------- --------------
1 OCR NORMAL 3060 2716 848
2 DATA NORMAL 409592 409392 204696
3 ARCHIVE EXTERN 102396 102308 102308
# 查询当前 ASM 磁盘
SQL> select group_number,disk_number,mount_status,name,failgroup,create_date,path from v$asm_disk order by 1,2;
GROUP_NUMBER DISK_NUMBER MOUNT_S NAME FAILGROUP CREATE_DA PATH
------------ ----------- ------- --------------- --------------- --------- ---------------------------
0 0 CLOSED /dev/oracleasm/asm-backup
1 0 CACHED OCR_0000 OCR_0000 14-NOV-19 /dev/oracleasm/asm-ocr3
1 1 CACHED OCR_0001 OCR_0001 14-NOV-19 /dev/oracleasm/asm-ocr2
1 2 CACHED OCR_0002 OCR_0002 14-NOV-19 /dev/oracleasm/asm-ocr1
2 0 CACHED DATA_0000 DATA_0000 14-NOV-19 /dev/oracleasm/asm-data1
2 1 CACHED DATA_0001 DATA_0001 14-NOV-19 /dev/oracleasm/asm-data2
3 0 CACHED ARCHIVE_0000 ARCHIVE_0000 14-NOV-19 /dev/oracleasm/asm-archived
# SQL 语句创建磁盘组 BAK
SQL> create diskgroup bak external redundancy disk '/dev/oracleasm/asm-backup' attribute 'au_size'='4M';
Diskgroup created.
# 查询 ASM 磁盘组
SQL> select group_number,name,type,total_mb,free_mb,usable_file_mb from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB USABLE_FILE_MB
------------ --------------- ------ ---------- ---------- --------------
1 OCR NORMAL 3060 2716 848
2 DATA NORMAL 409592 409392 204696
3 ARCHIVE EXTERN 102396 102308 102308
4 BAK EXTERN 511996 511916 511916
dbca -silent -createDatabase -templateName General_Purpose.dbc \
-gdbname SIASM19C \
-sid SIASM19C \
-databaseConfigType SI \
-createAsContainerDatabase TRUE \
-numberOfPDBs 1 \
-pdbName sales \
-useLocalUndoForPDBs TRUE \
-pdbAdminPassword oracle \
-sysPassword oracle \
-systemPassword oracle \
-characterSet AL32UTF8 \
-memoryPercentage 40 \
-storageType ASM \
-diskGroupName DATA \
-asmsnmpPassword oracle
登录 RDBMS 实例进行操作验证
[oracle@asmsi19c:/home/oracle]$sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 14 09:41:30 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SALES READ WRITE NO
SQL> select name from v$datafile where con_id=1;
NAME
-----------------------------------------------
+DATA/SIASM19C/DATAFILE/system.256.1024304637
+DATA/SIASM19C/DATAFILE/sysaux.257.1024304721
+DATA/SIASM19C/DATAFILE/undotbs1.258.1024304757
+DATA/SIASM19C/DATAFILE/users.259.1024304757