Oracle工具之nid命令的使用(二)

2014-11-24 17:34:15 · 作者: · 浏览: 1
nnected to an idle instance.



SQL> startup mount;


ORACLE instance started.



Total System Global Area 1252663296 bytes


Fixed Size 2226072 bytes


Variable Size 922749032 bytes


Database Buffers 318767104 bytes


Redo Buffers 8921088 bytes


Database mounted.




SQL> alter database open resetlogs;



Database altered.



SQL> select dbid,name from v$database;



DBID NAME


---------- ---------


3641774948 CRM




eg2 :仅更改数据库db_name



oracle@source ~]$ sqlplus / as sysdba



SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 5 00:11:03 2013



Copyright (c) 1982, 2010, Oracle. All rights reserved.




Connected to:


Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production


With the Partitioning, OLAP, Data Mining and Real Application Testing options



SQL> select open_mode from v$database;



OPEN_MODE


--------------------


READ WRITE



SQL> shutdown immediate;


Database closed.


Database dismounted.


ORACLE instance shut down.


SQL> startup mount;


ORACLE instance started.



Total System Global Area 1252663296 bytes


Fixed Size 2226072 bytes


Variable Size 905971816 bytes


Database Buffers 335544320 bytes


Redo Buffers 8921088 bytes


Database mounted.


SQL> exit


Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production


With the Partitioning, OLAP, Data Mining and Real Application Testing options


oracle@source ~]$ nid target=sys dbname=CRM_TEST setname=YES



DBNEWID: Release 11.2.0.2.0 - Production on Thu Dec 5 00:24:58 2013



Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.



Password:


Connected to database CRM (DBID=3641774948)



Connected to server version 11.2.0



Control Files in database:


/oracle/CRM/control03.ctl



Change database name of database CRM to CRM_TEST (Y/[N]) => y



Proceeding with operation


Changing database name from CRM to CRM_TEST


Control File /oracle/CRM/control03.ctl - modified


Datafile /oracle/CRM/system01.db - wrote new name


Datafile /oracle/CRM/sysaux01.db - wrote new name


Datafile /oracle/CRM/zx.db - wrote new name


Datafile /oracle/CRM/users01.db - wrote new name


Datafile /oracle/CRM/pos.db - wrote new name


Datafile /oracle/CRM/erp.db - wrote new name


Datafile /oracle/CRM/user01.db - wrote new name


Datafile /oracle/CRM/undotbs03.db - wrote new name


Datafile /oracle/CRM/crm.db - wrote new name


Datafile /oracle/CRM/jxc.db - wrote new name


Datafile /oracle/CRM/temp01.db - wrote new name


Control File /oracle/CRM/control03.ctl - wrote new name


Instance shut down



Database name changed to CRM_TEST.


Modify parameter file and generate a new password file before restarting.


Succesfully changed database name.


DBNEWID - Completed succesfully.



[oracle@source ~]$ sqlplus / as sysdba



SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 5 00:25:33 2013



Copyright (c) 1982, 2010, Oracle. All rights reserved.



Connected to an idle instance.



SQL> startup nomount;


ORACLE instance started.



Total System Global Area 1252663296 bytes


Fixed Size 2226072 bytes


Variable Size 905971816 bytes


Database Buffers 335544320 bytes


Redo Buffers 8921088 bytes



SQL> alter system set db_name=CRM_TEST scope=spfile;



System altered.



[oracle@source ~]$orapwd file="$ORACLE_HOME/dbs/orapw$ORACLE_SID" password=dhhzdhhz force=y



[oracle@source dbs]$ sqlplus / as sysdba



SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 5 00:34:40 2013



Copyright (c) 1982, 2010, Oracle. All rights reserved.




Connected to:


Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bi