ORACLE 11g 修改db_unique_name参数

前端之家收集整理的这篇文章主要介绍了ORACLE 11g 修改db_unique_name参数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1,查看原有的db_unique_name信息

sql> show parameter name;

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert             string
db_name                  string  orcl
db_unique_name               string  orcl
global_names                 boolean     FALSE
instance_name                string  orcl
lock_name_space              string
log_file_name_convert            string
service_names                string  orcl
sql>


2,创建临时pfile,修改db_unique_name

sql> create pfile='/oracle/p1.ora' from spfile;

File created.

sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sql>



修改临时pfile文件(/oracle/p1.ora)里面的db_unique_name值为orcl_m1,以临时pfile启动

vim /oracle/p1.ora
*.db_unique_name=orcl_m1


3,更新spfile、pile文件

根据修改的临时参数文件,更新默认的启动参数文件

sql> create spfile from pfile='/oracle/p1.ora';

File created.

sql>

根据新的spfile,然后更新默认的pfile

sql> create pfile from spfile;

File created.

sql>


4,启动数据库,查看db_unique_name已经变成新的名称

sql> startup;
ORACLE instance started.

Total System Global Area 2.6991E+10 bytes
Fixed Size          2213976 bytes
Variable Size        1.9596E+10 bytes
Database Buffers     7247757312 bytes
Redo Buffers          145174528 bytes
Database mounted.
Database opened.
sql> 
sql> show parameter name;

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert             string  /home/oradata/orcl,/home/
                         oradata/orcl
db_name                  string  orcl
db_unique_name               string  orcl_m1
global_names                 boolean     FALSE
instance_name                string  orcl
lock_name_space              string
log_file_name_convert            string  /home/oradata/orcl,/home/
                         oradata/orcl
service_names                string  orcl
sql>


5,最后有一种直接在线上online改然后重启生效

sql> alter system set db_unique_name='orcl_m1' scope=spfile;

System altered.

sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sql> 
sql> startup ;
ORACLE instance started.

Total System Global Area 2.6991E+10 bytes
Fixed Size          2213976 bytes
Variable Size        1.9596E+10 bytes
Database Buffers     7247757312 bytes
Redo Buffers          145174528 bytes
Database mounted.
Database opened.
sql> 
sql>  show parameter db_unique_name;

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
db_unique_name               string  orcl_m1
sql>
原文链接:https://www.f2er.com/oracle/209930.html

猜你在找的Oracle相关文章