[20170209]db_unique_name.txt
--前几天测试dataguard配置缺少fal_client,fal_server,log_archive_config,db_unique_name设置,会不会出现问题:
--链接:
http://blog.itpub.net/267265/viewspace-2133107/
http://blog.itpub.net/267265/viewspace-2133250/
--还有测试了db_unique_name设置错误,也能正常传输与应用日志.
--今天学习了解db_unique_name来自哪里.
1.环境与说明
SCOTT@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> show parameter name
NAME TYPE VALUE
---------------------- -------- ------------------------------------
cell_offloadgroup_name string
db_file_name_convert string /mnt/ramdisk/book, /mnt/ramdisk/book
db_name string book
db_unique_name string BOOK
global_names boolean FALSE
instance_name string book
lock_name_space string
log_file_name_convert string /mnt/ramdisk/book, /mnt/ramdisk/book
processor_group_name string
service_names string BOOK
--//这个是我测试库的当前情况,实际上oracle的*name*参数是最容易紊乱的参数.
--//db_name , db_unique_name ,instance_name ,service_names .
--//我前面的测试如果我没有设置db_unique_name,我一直认为缺省应该就是等于ORACLE_SID环境变量,实际上不是.
--//我前面的dg设置ORACLE_SID=bookdg,而db_unique_name默认是book.到底默认来之哪里?
2.测试:
-//建立一个initxxxx.ora文件.内容如下:
$ cat initxxxx.ora
db_name=aaaa
instance_name=bbbb
$ export ORACLE_SID=xxxx
$ rlsql
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 9 08:47:23 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SYS@xxxx> startup nomount
ORACLE instance started.
Total System Global Area 451006464 bytes
Fixed Size 2254024 bytes
Variable Size 339741496 bytes
Database Buffers 100663296 bytes
Redo Buffers 8347648 bytes
SYS@xxxx> show parameter name
NAME TYPE VALUE
----------------------- -------- ---------------
cell_offloadgroup_name string
db_file_name_convert string
db_name string aaaa
db_unique_name string aaaa
global_names boolean FALSE
instance_name string bbbb
lock_name_space string
log_file_name_convert string
processor_group_name string
service_names string aaaa
--//可以发现db_unique_name不定义的情况下来之db_name参数,这也是我前面的情况相符.
3.另外注意的问题:
--//如果你定义db_unique_name不等于db_name,或者与控制文件的记录不一致,在mount阶段,oracle会改写控制文件的对应信息.
Set as converted control file due to db_unique_name mismatch
Changing di2dbun from book to bookdg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> db_unique_name被修改回来了.
ARCH: STARTING ARCH PROCESSES
Mon Feb 06 11:28:48 2017
ARC0 started with pid=20, OS id=23826
ARC0: Archival started