همانطور که می دانید ایجاد دستی و یا خودکار Auxiliary Instance در زمان انجام عملیاتی چون Duplicate، PDB Point-in-Time Recovery، Table Point-in-Time Recovery و … الزامی می باشد البته با انجام هر کدام از این عملیاتها، Auxiliary Instance حذف خواهد شد و امکان استفاده از استفاده از این instance به صورت کلی از بین خواهد رفت.
برای مثال پس از اجرای دستورات زیر که در اوراکل نسخه 18c اجرا شده خواهیم دید که Auxiliary Instance هم حذف خواهد شد:
RMAN> RUN {
2> RECOVER TABLE usef.mytbl UNTIL SCN 784521398288
3> AUXILIARY DESTINATION ‘/oracle/aux’
4> DATAPUMP DESTINATION ‘/oracle/dmp’
5> DUMP FILE ‘mydmp.dmp’
6> NOTABLEIMPORT;
7> }
Starting recover at 20-MAY-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1148 device type=DISK
List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDO02
Creating automatic instance, with SID=’nAFd’
….
Removing automatic instance
shutting down automatic instance
Oracle instance shut down
Automatic instance removed
auxiliary instance file /oracle/aux/DB18C/datafile/o1_mf_temp_hdb47mhb_.tmp deleted
auxiliary instance file /oracle/aux/NAFD_PITR_DB18C/onlinelog/o1_mf_3_hdb49zwd_.log deleted
auxiliary instance file /oracle/aux/NAFD_PITR_DB18C/onlinelog/o1_mf_2_hdb49zvf_.log deleted
auxiliary instance file /oracle/aux/NAFD_PITR_DB18C/onlinelog/o1_mf_1_hdb49zsj_.log deleted
auxiliary instance file /oracle/aux/NAFD_PITR_DB18C/datafile/o1_mf_tbs2_hdb49wpf_.dbf deleted
auxiliary instance file /oracle/aux/DB18C/datafile/o1_mf_sysaux_hdb461x4_.dbf deleted
auxiliary instance file /oracle/aux/DB18C/datafile/o1_mf_undo02_hdb461xf_.dbf deleted
auxiliary instance file /oracle/aux/DB18C/datafile/o1_mf_system_hdb461x7_.dbf deleted
auxiliary instance file /oracle/aux/DB18C/controlfile/o1_mf_hdb45vos_.ctl deleted
Finished recover at 20-MAY-20
RMAN> **end-of-file**
دستور زیر در حین اجرای دستور recover اجرا شده است:
[oracle@ol6 datafile]$ ps -eaf|grep pmon|grep -v grep
oracle 2807 1 0 15:03 ? 00:00:00 ora_pmon_db18c
oracle 6607 1 0 15:44 ? 00:00:00 ora_pmon_nAFd
دستور زیر پس از اتمام عملیات RMAN اجرا شده است:
[oracle@ol6 datafile]$ ps -eaf|grep pmon|grep -v grep
oracle 2807 1 0 15:03 ? 00:00:00 ora_pmon_db18c
پارامتر KEEP AUXILIARY در اوراکل 19c
در اوراکل نسخه 19c، با کمک پارامتر KEEP AUXILIARY می توان از حذف شدن auxiliary instance جلوگیری کرد:
RMAN> RUN {
RECOVER TABLE usef.mytbl UNTIL SCN 2579000
AUXILIARY DESTINATION ‘/oracle/aux’
DATAPUMP DESTINATION ‘/oracle/dmp’
DUMP FILE ‘mydmp.dmp’
NOTABLEIMPORT
KEEP AUXILIARY;
}
Starting recover at 26-MAY-20
using channel ORA_DISK_1
List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1
Creating automatic instance, with SID=’xaes’
initialization parameters used for automatic instance:
db_name=DB19C
db_unique_name=xaes_pitr_DB19C
compatible=19.0.0
db_block_size=8192
db_files=200
diagnostic_dest=/19c/base
_system_trig_enabled=FALSE
sga_target=3568M
processes=200
db_create_file_dest=/oracle/aux
log_archive_dest_1=’location=/oracle/aux’
#No auxiliary parameter file used
starting up automatic instance DB19C
….
Performing export of tables…
EXPDP> Starting “SYS”.”TSPITR_EXP_xaes_xitv”:
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
EXPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
EXPDP> . . exported “USEF”.”MYTBL” 20.39 KB 7 rows
EXPDP> Master table “SYS”.”TSPITR_EXP_xaes_xitv” successfully loaded/unloaded
EXPDP> ******************************************************************************
EXPDP> Dump file set for SYS.TSPITR_EXP_xaes_xitv is:
EXPDP> /oracle/dmp/mydmp.dmp
EXPDP> Job “SYS”.”TSPITR_EXP_xaes_xitv” successfully completed at Tue May 26 02:25:24 2020 elapsed 0 00:00:27
Export completed
Not performing table import after point-in-time recovery
Finished recover at 26-MAY-20
RMAN>
بعد از انجام عملیات ریکاوری، خواهیم دید که auxiliary instanceای با نام xaes کماکان در حال اجرا می باشد:
[oracle@ol7 ~]$ ps -eaf|grep pmon
oracle 3984 1 0 02:24 ? 00:00:00 ora_pmon_xaes
همانند دیگر instanceها، DBA می تواند به xaes متصل شود:
[oracle@ol7 ~]$ export ORACLE_SID=xaes
[oracle@ol7 ~]$ sqlplus “/as sysdba”
SQL*Plus: Release 19.0.0.0.0 – Production on Tue May 26 02:38:19 2020
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> select file#,status from v$datafile;
FILE# STATUS
———- ——-
1 SYSTEM
2 ONLINE
3 ONLINE
4 ONLINE
5 OFFLINE
7 OFFLINE
8 OFFLINE
7 rows selected.
همچنین DBA می تواند این instance را مدیریت کند:
SQL> shut abort
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 3741317648 bytes
Fixed Size 8903184 bytes
Variable Size 771751936 bytes
Database Buffers 2952790016 bytes
Redo Buffers 7872512 bytes
SQL> alter database mount clone database;
Database altered.
SQL> alter database open;
Database altered.
SQL>
در صورت رخ دادن خطا حین انجام عملیات ریکاوری، باز هم auxiliary instance حفظ خواهد شد:
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oracle/aux/DB19C/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oracle/aux/DB19C/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oracle/aux/DB19C/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/bkp/09v14k65_1_1
^C
user interrupt received
One or more auxiliary set of datafiles could not be removed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/26/2020 04:26:43
RMAN-03015: error occurred in stored script Memory Script
RMAN-12005: error during channel cleanup
ORA-06515: PL/SQL: unhandled exception 99999
[oracle@ol7 ~]$ ps -eaf|grep pmon
oracle 1823 1 0 02:06 ? 00:00:01 ora_pmon_db19c
oracle 13445 1 0 04:26 ? 00:00:00 ora_pmon_ecCy