DNFS ‘ Aktif Edilmesi
ZFS stoarage da kullanici id ve grup id lerin OS ile yani yapilmasi gerekir.
Database sunucularda DNFS’in enable edilmesi (RAC ortamında iseniz çalışmasını istediğiniz nodelarda,)
Bu makelede 2 node lu rac sunucudan alınan backup single instance olarak açılmıştır.
1 2 |
cd $ORACLE_HOME/rdbms/lib make -f ins_rdbms.mk dnfs_on |
Aslında yaptigi işlem
1 2 |
rm -f /u01/app/oracle/product/11.2.0.4/db_1/lib/libodm11.so cp /u01/app/oracle/product/11.2.0.4/db_1/lib/libnfsodm11.so /u01/app/oracle/product/11.2.0.4/db_1/lib/libodm11.so |
#Disable etmek istenirse
1 |
make -f ins_rdbms.mk dnfs_off |
#DB restart edilir alert log da DNFS ile ilgili satır görülür
1 2 3 4 5 |
#mkdir /dnfs01 chown -R oracle:oinstall /dnfs01/ #mkdir /dnfs02 chown -R oracle:oinstall /dnfs02/ |
Linux
/etc/fstab
1 2 |
172.16.1.222:/export/com1 /dnfs01 nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0 172.16.1.223:/export/com2 /dnfs02 nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0 |
Solaris
/etc/vfstab
1 2 |
172.16.1.222:/export/com1 - /dnfs01 nfs - yes rw,bg,hard,rsize=131072,wsize=131072,vers=3,nointr,timeo=600,proto=tcp,noac 172.16.1.223:/export/com2 - /dnfs02 nfs - yes rw,bg,hard,rsize=131072,wsize=131072,vers=3,nointr,timeo=600,proto=tcp,noac |
Manuel mount etmek için ;
linux
1 |
mount -o rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp 10.1.1.14:/data/dba_nfs /mnt/nfs |
solaris
1 |
mount -o rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp 10.1.1.14:/data/dba_nfs /mnt/nfs |
#Barındırılacak dosya tipine (dbf,redo,binary,rman backup) göre mount options ları farklılık gösterir. DNFS üzerinde redo/datafile vote ocr gibi dosyaları barındırabilirsiniz tabi versiyona göre
örnek
1 2 3 4 5 6 7 8 |
172.16.1.223:/export/data01 - /ZFSBackup/data01 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.222:/export/data02 - /ZFSBackup/data02 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.223:/export/redolog01 - /ZFSBackup/redolog01 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.222:/export/redolog01 - /ZFSBackup/redolog02 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.223:/export/Backup01 - /ZFSBackup/backup01 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.222:/export/Backup01 - /ZFSBackup/backup01 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.223:/export/undo02 - /ZFSBackup/undo02 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr 172.16.1.222:/export/undo01 - /ZFSBackup/undo01 nfs - no rw,bg,hard,nointr,rsize=1048576,wsize=1048576,proto=tcp,vers=3,llock,xattr |
1 |
$ORACLE_HOME/dbs/orafstab |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#### Controller 1 server:172.16.1.222 local:172.16.1.200 path:172.16.1.222 local:172.16.1.201 path:172.16.1.222 local:172.16.1.202 path:172.16.1.222 local:172.16.1.203 path:172.16.1.222 dontroute export: /export/r12datap1 mount:/r12datap1 #### Controller 2 server:172.16.1.223 local:172.16.1.200 path:172.16.1.223 local:172.16.1.201 path:172.16.1.223 local:172.16.1.202 path:172.16.1.223 local:172.16.1.203 path:172.16.1.223 dontroute export: /export/r12datap2 mount:/r12datap2 |
Tavsiye Edilen Dökümanlar
How To Setup DNFS (Direct NFS) On Oracle Release 11.2 (Doc ID 1452614.1)
Mount Options for Oracle files when used with NFS on NAS devices (Doc ID 359515.1)
Step by Step – Configure Direct NFS Client (DNFS) on Linux (11g) (Doc ID 762374.1)
Clone your dNFS Production Database for Testing (Doc ID 1210656.1)
Recommended Patches for Direct NFS Client (Doc ID 1495104.1)
Direct NFS monitoring and v$views (Doc ID 1495739.1)
Direct NFS Frequently Asked Questions 1496040.1
Direct NFS monitoring and v$views 1495739.1
Karşılaşılan sorunlar ve çözümleri
Direct NFS: Failed to set socket buffer size.wtmax=[1048576] rtmax=[1048576], errno=-1
Database Alert Log entries: Direct NFS: Failed to set socket buffer size.wtmax=[1048576] rtmax=[1048576], errno=-1 (Doc ID 1352886.1)
This note covers some Frequently Asked Questions related to Direct NFS (Doc ID 1496040.1)
solaris
1 2 3 |
ndd -set /dev/tcp tcp_max_buf 1056768 ndd -set /dev/tcp tcp_xmit_hiwat 1056768 ndd -set /dev/tcp tcp_recv_hiwat 1056768 |
Kalıcı olması için
/etc/inittab
1 2 3 |
tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_max_buf 1056768 tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 1056768 tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 1056768 |
1 2 3 4 5 6 |
ndd -set /dev/tcp tcp_conn_req_max_q 16384 ndd -set /dev/tcp tcp_conn_req_max_q0 16384 ndd -set /dev/tcp tcp_max_buf 4194304 ndd -set /dev/tcp tcp_cwnd_max 2097152 ndd -set /dev/tcp tcp_recv_hiwat 400000 ndd -set /dev/tcp tcp_xmit_hiwat 400000 |
Sorgulamak için
1 2 3 4 5 6 |
ndd -get tcp_conn_req_max_q ndd -get tcp_conn_req_max_q0 ndd -get tcp_max_buf ndd -get tcp_cwnd_max ndd -get tcp_recv_hiwat ndd -get tcp_xmit_hiwat |
Linux
Linux – For Linux, please check the values of the following parameters and bump up the max to be greater than 1056768.
1 2 3 4 |
cat /proc/sys/net/core/rmem_max cat /proc/sys/net/core/wmem_max cat /proc/sys/net/ipv4/tcp_rmem cat /proc/sys/net/ipv4/tcp_wmem |
********************************
DNFS’e Backup
Clone için Backup
1 2 3 4 5 6 7 |
run { sql 'alter database begin backup'; set nocfau; backup as copy database format '/dnfs/1backup/d_%U_.dbf' ; sql 'alter database end backup'; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
run { sql 'alter system set "_backup_disk_bufcnt"=64 scope=memory' ; sql 'alter system set "_backup_file_bufcnt"=64 scope=memory' ; sql 'alter system set "_backup_disk_bufsz"=1048576 scope=memory' ; sql 'alter system set "_backup_file_bufsz"=1048576 scope=memory' ; configure device type disk parallelism 16 backup type to copy; allocate channel ch1 device type disk format '/backup01/rman/%U' ; allocate channel ch2 device type disk format '/backup01/rman/%U' ; allocate channel ch3 device type disk format '/backup01/rman/%U' ; allocate channel ch4 device type disk format '/backup01/rman/%U' ; allocate channel ch5 device type disk format '/backup01/rman/%U' ; allocate channel ch6 device type disk format '/backup01/rman/%U' ; allocate channel ch7 device type disk format '/backup01/rman/%U' ; allocate channel ch8 device type disk format '/backup01/rman/%U' ; allocate channel ch9 device type disk format '/backup02/rman/%U' ; allocate channel ch10 device type disk format '/backup02/rman/%U' ; allocate channel ch11 device type disk format '/backup02/rman/%U' ; allocate channel ch12 device type disk format '/backup02/rman/%U' ; allocate channel ch13 device type disk format '/backup02/rman/%U' ; allocate channel ch14 device type disk format '/backup02/rman/%U' ; allocate channel ch15 device type disk format '/backup02/rman/%U' ; allocate channel ch16 device type disk format '/backup02/rman/%U' ; backup as backupset incremental level 0 section size 64g database tag 'FullBackUpSet_L0' plus archivelog tag 'FullBackUpSet_L0'; |
1 2 3 4 5 6 7 8 9 10 |
run { configure device type disk parallelism 4 backup type to copy; allocate channel ch1 device type disk format '/nfs/backup/prod1/%U' ; allocate channel ch2 device type disk format '/nfs/backup/prod1/%U' ; allocate channel ch3 device type disk format '/nfs/backup/prod1/%U' ; allocate channel ch4 device type disk format '/nfs/backup/prod1/%U' ; backup incremental level 1 for recover of copy with tag 'zfssa_clone' database reuse; recover copy of database with tag 'zfssa_clone'; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
#!/bin/bash # Full hot backup script #usage: {path}/export.sh SID {hotbkup path} # example: /u01/app/oracle/admin/scripts/imagebck.sh orcl1 /backup01/dnfs01/orcl1 # example: /u01/app/oracle/admin/scripts/imagebck.sh orcl1 /backup01/dnfs01/orcl1 } /backup01/dnfs01/rman.log # this script will exit if instance is not running on this server # ps -ef | grep -v grep | grep ora_pmon_$1 | wc -l | while read CONTROL do if [ "$CONTROL" -gt 0 ] ; then ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1 export ORACLE_HOME PATH=$ORACLE_HOME/bin:$PATH:/bin:/usr/bin:usr/local/bin:. export PATH ORACLE_SID=$1 export ORACLE_SID=$1 BKUPLOC=$2; export BKUPLOC # rm $BKUPLOC/*.bkp # rm $BKUPLOC/*.bkp.gz rman target=/@BCKP catalog=<a href="mailto:target=/@BCKP catalog=/" rel="noopener noreferrer">/</a>@CAT log /dnfs/backup.log {{EOF sql 'alter system set "_backup_disk_bufcnt"=64 scope=memory' ; sql 'alter system set "_backup_file_bufcnt"=64 scope=memory' ; sql 'alter system set "_backup_disk_bufsz"=1048576 scope=memory' ; sql 'alter system set "_backup_file_bufsz"=1048576 scope=memory' ; configure device type disk parallelism 32 backup type to copy; run { sql 'alter database begin backup'; set nocfau; backup as copy database format '$BKUPLOC/d_%U_.dbf' ; sql 'alter database end backup'; } exit EOF fi done |
********************************
DNFS’e Clone
2 node lu asm kullanan 111.2.0.4.0 RDBMS den alınan rman backup tek nodelu test ortamına clonelandı
Hedef sunucuda yani clone DB nin açılacağı sunucuda olduğu varsıyılanlar
a- Aynı versiyon ve patch seviyesinde RDBMS ‘in kurulumun yapıdığı,
b- DNSFS ayarlarının yapıldığı
c- mount ların oracle options ile yapıldığı
linux
#/etc/fstab
172.16.1.222:/export/CloneBackup /ZFSBackup/TestClone/ nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0
Adım_1 backup kaynak makineden backup alınır.
1 2 3 4 5 6 7 |
run { sql 'alter database begin backup'; set nocfau; backup as copy database format '/ZFSBackup/TestClone/d_%U_.dbf' ; sql 'alter database end backup'; } |
Adım_2 Çevre değişkenleri set edilir.
1 2 3 4 |
export ORACLE_SID=TEST export MASTER_COPY_DIR=/ZFSBackup/TestClone/ # backup alinan yer, burda datafile dan baska bişiy olmasın. export CLONE_FILE_CREATE_DEST=/u01/app/oracle/oradata/TEST # restore edilecek yer dnsf uzerinde de olabilir export CLONEDB_NAME=TEST |
Adım_3 pfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#$ORACLE_HOME/dbs/initTEST.ora *.audit_file_dest='/u01/app/oracle/admin/TEST/adump' *.audit_trail='DB' *.compatible='11.2.0.4.0' *.control_files='/u01/app/oracle/oradata/TEST/control01.ctl','/u01/app/oracle/oradata/TEST/control02.ctl' *.db_block_size=8192 *.db_create_file_dest='/u01/app/oracle/oradata/TEST/' *.db_domain='WORLD' *.db_name='TEST' *.db_recovery_file_dest_size=4070572032 *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=TESTXDB)' *.event='' *.memory_target=843055104 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1' *.clonedb=true _no_recovery_through_resetlogs=TRUE |
1 2 |
mkdir -p /u01/app/oracle/admin/TEST/adump mkdır -p /u01/app/oracle/fast_recovery_area |
Adım_4 scriptler oluşturulur
cd /ZFSBackup/
oracle support dan clone.pl download edilir (Clone your dNFS Production Database for Testing (Doc ID 1210656.1))
crtdb.sql : VT’ yi nomount modda açar ve control file oluşturur.
dbren.sql : dbf leri rename eder ve VT’yi open resetlogs ile açar.
1 |
perl /ZFSBackup/clone.pl /u01/app/oracle/product/11.2.0/db_1/dbs/initTEST.ora crtdb.sql dbren.sql |
1 2 3 |
$sqlplus / as sysdba sqlplus}@crtdb.sql sqlplus}@dbren.sql |
log
1 |
tail -2000f /u01/app/oracle/diag/rdbms/test/TEST/trace/alert_TEST.log |
Eğer hata alınırsa
1 2 |
#chmod 4755 $ORACLE_HOME/bin/oradism alter database open resetlogs |
Açmak istediğinde , hata dönebilir. Bu durumda ;
Kaynak VT’nin tüm nod larında
1 |
alter system switch logfile ; |
Komutu verilir ve arşivlenen son bir kaç archive log, klon VT’ nin erişebileceği bir lokasyon gönderilir .
Archivelog lar ASM disklerde ise ;
Kaynak VT’de
1 2 |
asmcmd>cd +FRA/$SID_ISMI/Archivelog/ asmcmd>cp thread_2_seq_167.20291.863282743 /ZFSbackup/Cont1_orcl_1/thread_2_seq_167.20291.863282743 |
1 2 3 4 5 6 |
sql>recover database using backup controlfile until cancel; ORA-00279: change 649615 generated at 04/22/2009 22:29:06 needed for thread 1 ORA-00289: suggestion : /oracle/ArchiveLogs/ORT24FS/1_2_684196024.dbf ORA-00280: change 649615 for thread 1 is in sequence #2 Specify log: {=suggested | filename | AUTO | CANCEL} |
Hatası alındığında kopyalanan archivelog ların tam yolu verilir.
1 2 |
chown oracle:oinstall /ZFSbackup/Cont1_orcl_1/thread_2_seq_167.20291.863282743 /ZFSbackup/Cont1_orcl_1/thread_2_seq_167.20291.863282743 |
Bir iki tane gosterdikten sonra cancel ile de denenebilir.
***************************
RMAN ile farklı...
12 Mart 2019