重庆思庄Oracle、Redhat认证学习论坛
标题:
OMF文件管理模式之主备数据文件名的测试
[打印本页]
作者:
denglj
时间:
2022-5-11 09:28
标题:
OMF文件管理模式之主备数据文件名的测试
数据库:oracle 11.2.0.4
系统:CentOS 7.9
主库:非OMF文件管理
备库:OMF文件管理
测试目标:主库添加数据文件,备库自动添加的数据文件名是否与主库一致?
主库操作:
SQL> show parameter db_create
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
SQL> select file_name,autoextensible,bytes/1024/1024,tablespace_name from dba_data_files order by 1
FILE_NAME AUT BYTES/1024/1024 TABLESPACE_NAME
-------------------------------------------------- --- --------------- ------------------------------
/u01/app/oracle/oradata/orcl150/sysaux01.dbf YES 500 SYSAUX
/u01/app/oracle/oradata/orcl150/system01.dbf YES 740 SYSTEM
/u01/app/oracle/oradata/orcl150/undotbs01.dbf YES 30 UNDOTBS1
/u01/app/oracle/oradata/orcl150/users01.dbf YES 5 USERS
/u01/app/oracle/oradata/orcl150/users02.dbf YES 10 USERS
--给表空间users添加数据文件
SQL> alter tablespace users add datafile '/u01/app/oracle/oradata/orcl150/users03.dbf' size 20m autoextend on;
Tablespace altered.
SQL> select file_name,autoextensible,bytes/1024/1024,tablespace_name from dba_data_files order by 1;
FILE_NAME AUT BYTES/1024/1024 TABLESPACE_NAME
-------------------------------------------------- --- --------------- ------------------------------
/u01/app/oracle/oradata/orcl150/sysaux01.dbf YES 500 SYSAUX
/u01/app/oracle/oradata/orcl150/system01.dbf YES 740 SYSTEM
/u01/app/oracle/oradata/orcl150/undotbs01.dbf YES 30 UNDOTBS1
/u01/app/oracle/oradata/orcl150/users01.dbf YES 5 USERS
/u01/app/oracle/oradata/orcl150/users02.dbf YES 10 USERS
/u01/app/oracle/oradata/orcl150/users03.dbf YES 20 USERS
6 rows selected.
说明:users03.dbf为新添加文件
备库操作:
SQL> show parameter db_create_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string /u01/app/oracle/oradata/orcl151/
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> select file_name,autoextensible,bytes/1024/1024,tablespace_name from dba_data_files order by 1
FILE_NAME AUT BYTES/1024/1024 TABLESPACE_NAME
-------------------------------------------------------------------------------- --- --------------- ------------------------------
/u01/app/oracle/oradata/orcl151/ORCL151/datafile/o1_mf_users_k7l1mgvs_.dbf YES 20 USERS
/u01/app/oracle/oradata/orcl151/sysaux01.dbf YES 500 SYSAUX
/u01/app/oracle/oradata/orcl151/system01.dbf YES 740 SYSTEM
/u01/app/oracle/oradata/orcl151/undotbs01.dbf YES 30 UNDOTBS1
/u01/app/oracle/oradata/orcl151/users01.dbf YES 5 USERS
/u01/app/oracle/oradata/orcl151/users02.dbf YES 10 USERS
6 rows selected.
如上所示,o1_mf_users_k7l1mgvs_.dbf为备库自动新增的数据文件.
测试结论:若备库为OMF文件管理模式,主库添加数据文件对应的备库数据文件名是不同的,但不影响使用.
作者:
郑全
时间:
2022-5-11 22:36
db_file_name_convert和 DB_CREATE_FILE_DEST 同时存在时,DB_CREATE_FILE_DEST 优先。
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2