[20201112]nid改變資料庫名字.txt
[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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2733656/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- nid 改變資料庫名,DBID資料庫
- nid修改資料庫名稱資料庫
- 用NID修改資料庫名稱資料庫
- 使用NID修改Oracle資料庫名Oracle資料庫
- 3.2 改變資料庫可用性資料庫
- 改變資料庫undo表空間資料庫
- NID修改資料庫名稱時候碰到NID-00137資料庫
- Oracle NID工具修改資料庫DBID和資料庫名稱Oracle資料庫
- 11.2資料庫監聽的改變資料庫
- 在RAC中用NID修改資料庫名稱資料庫
- oracle 11g 修改資料庫名字和例項名字Oracle資料庫
- Java 8 徹底改變資料庫訪問Java資料庫
- 記下改變資料庫密碼的命令資料庫密碼
- 【原創】使用nid命令修改資料庫名稱資料庫
- 修改資料庫檔名字和路徑資料庫
- 2 Day DBA-使用DBCA改變資料庫配置資料庫
- [轉] 使用NID 修改資料庫名(Oracle9或以上)資料庫Oracle
- 為什麼開源資料庫改變許可證?資料庫
- Kubernetes 將改變資料庫的管理方式資料庫
- 【Mysql】改資料庫庫名操作MySql資料庫
- Oracle資料庫中一致讀行為的改變Oracle資料庫
- 資料資訊圖:App 改變世界APP
- 改變mysql資料存放路徑MySql
- [20211020]改變備庫的rman配置.txt
- win10怎麼改microsoft名字 win10系統microsoft名字如何改Win10ROS
- Kubernetes 將徹底改變企業資料庫管理? - thenewstack資料庫
- 雲端計算時代,資料庫架構設計有哪些改變?資料庫架構
- 大資料帶來了哪些改變大資料
- 大資料如何改變城市規劃大資料
- 改變資料檔案的路徑
- Entity Framework Model First下改變資料庫指令碼的生成方式Framework資料庫指令碼
- 急!請教資料庫記錄改變了如何通知頁面更新?資料庫
- oracle資料庫使用sqlldr命令匯入txt資料Oracle資料庫SQL
- [20120214]異常資料導致執行計劃改變.txt
- Oracle、mysql資料庫增、刪、改OracleMySql資料庫
- [20130902]Oracle 11G資料庫的一致讀性讀取行為的改變.txtOracle資料庫
- 人工智慧將如何改變資料安全人工智慧
- 大資料改變世界的五種方式大資料