12c dg環境測試 db_create_file_dest和db_file_name_convert引數,日誌如下:
(1)備庫引數檢視
SQL> show parameter db_create_file_dest;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string /u01/app/oracle/datafile/
SQL> show parameter db_file_name_convert;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string +DGDATA/SZTECH/, /u01/app/orac
le/oradata/DG_STANDBY/
pdb_file_name_convert string
SQL>
(2)主庫建立orclpdb2
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 ORCLPDB MOUNTED
SQL> create pluggable database orclpdb2 admin user test identified by test default tablespace users;
Pluggable database created.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB2 MOUNTED
4 ORCLPDB MOUNTED
SQL> alter system switch logfile;
System altered.
SQL>
(3)檢視備庫pdb,觀察orclpdb2資料檔案位置
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB2 MOUNTED
4 ORCLPDB MOUNTED
SQL> select con_id,file#,name from v$datafile;
CON_ID FILE# NAME
---------- ---------- --------------------------------------------------------------------------------------------------------------
1 1 /u01/app/oracle/oradata/DG_STANDBY/datafile/o1_mf_system_dt9nvfy1_.dbf
1 3 /u01/app/oracle/oradata/DG_STANDBY/datafile/o1_mf_sysaux_dt9nw7bh_.dbf
1 4 /u01/app/oracle/oradata/DG_STANDBY/datafile/o1_mf_undotbs1_dt9nwqf9_.dbf
2 5 /u01/app/oracle/oradata/DG_STANDBY/549033777C6D829FE05384E5A8C0DD12/datafile/o1_mf_system_dt9nwtso_.dbf
2 6 /u01/app/oracle/oradata/DG_STANDBY/549033777C6D829FE05384E5A8C0DD12/datafile/o1_mf_sysaux_dt9nx2cg_.dbf
1 7 /u01/app/oracle/oradata/DG_STANDBY/datafile/o1_mf_users_dt9nxkwj_.dbf
2 8 /u01/app/oracle/oradata/DG_STANDBY/549033777C6D829FE05384E5A8C0DD12/datafile/o1_mf_undotbs1_dt9nxmom_.dbf
1 9 /u01/app/oracle/oradata/DG_STANDBY/datafile/o1_mf_undotbs2_dt9nxql2_.dbf
4 54 /u01/app/oracle/oradata/DG_STANDBY/57C9813E82EC6BCFE05384E5A8C01DEE/datafile/o1_mf_system_dt9nxvb3_.dbf
4 55 /u01/app/oracle/oradata/DG_STANDBY/57C9813E82EC6BCFE05384E5A8C01DEE/datafile/o1_mf_sysaux_dt9ny36t_.dbf
4 56 /u01/app/oracle/oradata/DG_STANDBY/57C9813E82EC6BCFE05384E5A8C01DEE/datafile/o1_mf_undotbs1_dt9nylxm_.dbf
4 57 /u01/app/oracle/oradata/DG_STANDBY/57C9813E82EC6BCFE05384E5A8C01DEE/datafile/o1_mf_users_dt9nypdv_.dbf
4 58 /u01/app/oracle/oradata/DG_STANDBY/57C9813E82EC6BCFE05384E5A8C01DEE/datafile/o1_mf_test_dt9nyt32_.dbf
3 98 /u01/app/oracle/datafile/DG_STANDBY/57DB7177F05435FAE05384E5A8C0C484/datafile/system.258.dbf
3 99 /u01/app/oracle/datafile/DG_STANDBY/57DB7177F05435FAE05384E5A8C0C484/datafile/sysaux.264.dbf
3 100 /u01/app/oracle/datafile/DG_STANDBY/57DB7177F05435FAE05384E5A8C0C484/datafile/undotbs1.259.dbf
16 rows selected.
SQL>
測試結果:備庫同時設定db_create_file_dest和db_file_name_convert引數,以db_create_file_dest引數為準