[20201112]nid改变数据库名字.txt $ nid DBNEWID: Release 11.2.0.4.0 - Production on Thu Nov 12 08:40:15 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Keyword Description (Default) ---------------------------------------------------- TARGET Username/Password (NONE) DBNAME New database name (NONE) LOGFILE Output Log (NONE) REVERT Revert failed change NO SETNAME Set a new database name only NO APPEND Append to output log NO HELP Displays these messages NO --//很明显nid支持仅仅修改数据库名字,测试看看。 SYS@book> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SYS@book> startup mount ORACLE instance started. Total System Global Area 643084288 bytes Fixed Size 2255872 bytes Variable Size 205521920 bytes Database Buffers 427819008 bytes Redo Buffers 7487488 bytes Database mounted. $ nid TARGET=sys/oracle DBNAME=bookx SETNAME=YES DBNEWID: Release 11.2.0.4.0 - Production on Thu Nov 12 08:43:24 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to database BOOK (DBID=1337401710) Connected to server version 11.2.0 Control Files in database: /mnt/ramdisk/book/control01.ctl /mnt/ramdisk/book/control02.ctl Change database name of database BOOK to BOOKX? (Y/[N]) => Y Proceeding with operation Changing database name from BOOK to BOOKX Control File /mnt/ramdisk/book/control01.ctl - modified Control File /mnt/ramdisk/book/control02.ctl - modified Datafile /mnt/ramdisk/book/system01.db - wrote new name Datafile /mnt/ramdisk/book/sysaux01.db - wrote new name Datafile /mnt/ramdisk/book/undotbs01.db - wrote new name Datafile /mnt/ramdisk/book/users01.db - wrote new name Datafile /mnt/ramdisk/book/example01.db - wrote new name Datafile /mnt/ramdisk/book/tea01.db - wrote new name Datafile /mnt/ramdisk/book/temp01.db - wrote new name Control File /mnt/ramdisk/book/control01.ctl - wrote new name Control File /mnt/ramdisk/book/control02.ctl - wrote new name Instance shut down Database name changed to BOOKX. Modify parameter file and generate a new password file before restarting. Succesfully changed database name. DBNEWID - Completed succesfully. $ cp initbook.ora initbookx.ora --//修改initbookx.ora如下: --//注建立initbook.ora过程有点遗漏,后面补充。 $ grep bookx initbookx.ora bookx.__db_cache_size=377487360 bookx.__java_pool_size=12582912 bookx.__large_pool_size=12582912 bookx.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment bookx.__pga_aggregate_target=4294967296 bookx.__sga_target=645922816 bookx.__shared_io_pool_size=0 bookx.__shared_pool_size=209715200 bookx.__streams_pool_size=0 *.db_name='bookx' $ export ORACLE_SID=bookx SYS@bookx> startup mount ORACLE instance started. Total System Global Area 643084288 bytes Fixed Size 2255872 bytes Variable Size 205521920 bytes Database Buffers 427819008 bytes Redo Buffers 7487488 bytes Database mounted. --//注意启动有点慢是正常的,因为要建立许多目录以及相关信息。 SYS@bookx> alter database open read only ; Database altered. --//说明改名不需要resetlogs。 SYS@bookx> select * from scott.dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON --//再修改回来. SYS@bookx> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SYS@bookx> startup mount ORACLE instance started. Total System Global Area 643084288 bytes Fixed Size 2255872 bytes Variable Size 205521920 bytes Database Buffers 427819008 bytes Redo Buffers 7487488 bytes Database mounted. $ export ORACLE_SID=book $ nid TARGET=sys/oracle DBNAME=book SETNAME=YES DBNEWID: Release 11.2.0.4.0 - Production on Thu Nov 12 08:52:28 2020 Connected to database BOOKX (DBID=1337401710) Connected to server version 11.2.0 Control Files in database: /mnt/ramdisk/book/control01.ctl /mnt/ramdisk/book/control02.ctl Change database name of database BOOKX to BOOK? (Y/[N]) => Y Proceeding with operation Changing database name from BOOKX to BOOK Control File /mnt/ramdisk/book/control01.ctl - modified Control File /mnt/ramdisk/book/control02.ctl - modified Datafile /mnt/ramdisk/book/system01.db - wrote new name Datafile /mnt/ramdisk/book/sysaux01.db - wrote new name Datafile /mnt/ramdisk/book/undotbs01.db - wrote new name Datafile /mnt/ramdisk/book/users01.db - wrote new name Datafile /mnt/ramdisk/book/example01.db - wrote new name Datafile /mnt/ramdisk/book/tea01.db - wrote new name Datafile /mnt/ramdisk/book/temp01.db - wrote new name Control File /mnt/ramdisk/book/control01.ctl - wrote new name Control File /mnt/ramdisk/book/control02.ctl - wrote new name Instance shut down Database name changed to BOOK. Modify parameter file and generate a new password file before restarting. Succesfully changed database name. DBNEWID - Completed succesfully. SYS@book> startup ORACLE instance started. Total System Global Area 643084288 bytes Fixed Size 2255872 bytes Variable Size 205521920 bytes Database Buffers 427819008 bytes Redo Buffers 7487488 bytes Database mounted. Database opened. --//补充建立initbook.ora的步骤。 SYS@book> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. $ rlsql SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 12 08:55:34 2020 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SYS@book> create pfile='/tmp/@.ora' from spfile ; File created. --//执行该命令不需要nomount或者mount数据库。 SYS@book> host ls -l /tmp/book.ora -rw-r--r-- 1 oracle oinstall 1966 Nov 12 08:55 /tmp/book.ora
[20201112]nid改变数据库名字.txt
来源:这里教程网
时间:2026-03-03 16:16:46
作者:
编辑推荐:
- [20201111]11.2.0.4版本仍然存在的一个未修复Bug ora-00600 [13013].txt03-03
- [20201112]nid改变数据库名字.txt03-03
- python两种获取剪贴板内容的方法03-03
- [20201111]CURSOR_SPACE_FOR_TIME.txt03-03
- [20201113]测试CURSOR_SPACE_FOR_TIME(10g).txt03-03
- 宝塔面板nginx防火墙非浏览器拦截真的有用吗?03-03
- [20201116]测试CURSOR_SPACE_FOR_TIME(10g)(补充).txt03-03
- [20201116]测试CURSOR_SPACE_FOR_TIME=false(11g).txt03-03
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- oracle删除表中数据(delete与truncate)
oracle删除表中数据(delete与truncate)
26-03-03 - SQL Server数据库mdf文件中了勒索病毒*.mdf.[helpbackup@email.tg].Devos
- G006-ORACLE-INS-SIFS-01 ORACLE 19C SIFS Ins ON RHEL 8.2
- G008-ORACLE-DG ORACLE 19C Active Data Guard DML Redirection
- 查看oracle数据库中,哪些表的字段是null值比较多
查看oracle数据库中,哪些表的字段是null值比较多
26-03-03 - Oracle数据库服务器dbf文件中了勒索病毒,扩展名被篡改为.CC7H
Oracle数据库服务器dbf文件中了勒索病毒,扩展名被篡改为.CC7H
26-03-03 - 数据库范式
数据库范式
26-03-03 - 沙龙回顾丨开发者掌握这些背后的技术路径,可助力企业智能化升级
沙龙回顾丨开发者掌握这些背后的技术路径,可助力企业智能化升级
26-03-03 - Oracle的awr报告分析
Oracle的awr报告分析
26-03-03 - DDD 在京东 DevOps 项目协作领域的落地实战
DDD 在京东 DevOps 项目协作领域的落地实战
26-03-03
