运行下面的命令,即可更改db_name 从haha 更改为test>nid target=sys/gaokai@haha dbname=test下面演示:
- C:Documents and Settingsandyleng>set Oracle_SID=haha
-
- C:Documents and Settingsandyleng>sqlplus /nolog
-
- SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 2 18:07:00 2011
-
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
-
- SQL> conn /as sysdba
- Connected to an idle instance.
- SQL> startup
- ORACLE instance started.
-
- Total System Global Area 778387456 bytes
- Fixed Size 1374808 bytes
- Variable Size 234882472 bytes
- Database Buffers 536870912 bytes
- Redo Buffers 5259264 bytes
- Database mounted.
- Database opened.
- SQL> show parameter name
-
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_file_name_convert string
- db_name string haha
- db_unique_name string haha
- global_names boolean FALSE
- instance_name string haha
- lock_name_space string
- log_file_name_convert string
- service_names string haha
- SQL> create pfile from spfile;
-
- File created.
-
- SQL> shutdown immediate;
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
- oduction
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
- C:Documents and Settingsandyleng>
- C:Documents and Settingsandyleng>set ORACLE_SID=haha
-
- C:Documents and Settingsandyleng>sqlplus /nolog
-
- SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 2 18:08:40 2011
-
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
-
- SQL> conn /as sysdba
- Connected to an idle instance.
- SQL> startup mount;
- ORACLE instance started.
-
- Total System Global Area 778387456 bytes
- Fixed Size 1374808 bytes
- Variable Size 234882472 bytes
- Database Buffers 536870912 bytes
- Redo Buffers 5259264 bytes
- Database mounted.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
- oduction
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
- C:Documents and Settingsandyleng>nid target=sys/oracle@haha dbname=test
-
- DBNEWID: Release 11.2.0.1.0 - Production on Wed Nov 2 18:11:10 2011
-
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
-
- Connected to database HAHA (DBID=3533083211)
-
- Connected to server version 11.2.0
-
- Control Files in database:
- D:ORACLEORADATATESTCONTROL01.CTL
- D:ORACLEFLASH_RECOVERY_AREATESTCONTROL02.CTL
-
- Change database ID and database name HAHA to TEST? (Y/[N]) => y
-
- Proceeding with operation
- Changing database ID from 3533083211 to 2064306111
- Changing database name from HAHA to TEST
- Control File D:ORACLEORADATATESTCONTROL01.CTL - modified
- Control File D:ORACLEFLASH_RECOVERY_AREATESTCONTROL02.CTL - modified
- Datafile D:ORACLEORADATATESTSYSTEM01.DB - dbid changed, wrote new name
- Datafile D:ORACLEORADATATESTSYSAUX01.DB - dbid changed, wrote new name
- Datafile D:ORACLEORADATATESTUNDOTBS01.DB - dbid changed, wrote new name
- Datafile D:ORACLEORADATATESTUSERS01.DB - dbid changed, wrote new name
- Datafile D:ORACLEORADATATESTATG_TBS01.DB - dbid changed, wrote new name
- Datafile D:ORACLEORADATATESTATG_LOBTBS01.DB - dbid changed, wrote new na
- me
- Datafile D:ORACLEORADATATESTTEMP01.DB - dbid changed, wrote new name
- Control File D:ORACLEORADATATESTCONTROL01.CTL - dbid changed, wrote new
- name
- Control File D:ORACLEFLASH_RECOVERY_AREATESTCONTROL02.CTL - dbid changed
- , wrote new name
- Instance shut down
-
- Database name changed to TEST.
- Modify parameter file and generate a new password file before restarting.
- Database ID for database TEST changed to 2064306111.
- All previous backups and archived redo logs for this database are unusable.
- Database is not aware of previous backups and archived logs in Recovery Area.
- Database has been shutdown, open database with RESETLOGS option.
- Succesfully changed database name and ID.
- DBNEWID - Completed succesfully.
-
-
- C:Documents and Settingsandyleng>ORADIM -del -sid haha
- Instance deleted.
-
- C:Documents and Settingsandyleng>oradim -new -sid test
- Instance created.
-
- C:Documents and Settingsandyleng>set ORACLE_SID=test
-
- C:Documents and Settingsandyleng>sqlplus /nolog
-
- SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 2 18:12:50 2011
-
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
-
- SQL> conn /as sysdba
- Connected to an idle instance.
- SQL> startup
- ORACLE instance started.
-
- Total System Global Area 778387456 bytes
- Fixed Size 1374808 bytes
- Variable Size 427820456 bytes
- Database Buffers 343932928 bytes
- Redo Buffers 5259264 bytes
- Database mounted.
- ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
-
-
- SQL> create spfile from pfile;
-
- File created.
-
- SQL> alter database open resetlogs;
-
- Database altered.
-
- SQL> show parameter name
-
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- db_file_name_convert string
- db_name string test
- db_unique_name string test
- global_names boolean FALSE
- instance_name string test
- lock_name_space string
- log_file_name_convert string
- service_names string test
- SQL>
Oracle导机迁移全过程Oracle中存储过程如何控制提交和回滚相关资讯 Oracle数据库 Oracle入门教程 oracle数据库教程
- Oracle数据库全球化 (03月01日)
- Oracle数据库日期过滤方法性能比较 (02/02/2015 13:20:26)
- Oracle数据库安装中端口被占用问题 (10/29/2014 07:42:24)
| - 在CentOS 6.6上搭建C++运行环境并 (10/10/2015 19:44:40)
- Oracle数据库无法使用localhost和 (11/14/2014 16:39:10)
- 使用SQLT来构建Oracle测试用例 (08/28/2014 06:17:41)
|
本文评论 查看全部评论 (0)