[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修改資料庫名稱資料庫
- 用NID修改資料庫名稱資料庫
- 使用NID修改Oracle資料庫名Oracle資料庫
- [20201112]time TIMEFORMAT格式.txtORM
- [20211020]改變備庫的rman配置.txt
- 在RAC中用NID修改資料庫名稱資料庫
- 3.2 改變資料庫可用性資料庫
- [20201112]tmpwatch 刪除檔案.txt
- [20200407]nid修改DBID還原.txt
- Kubernetes 將改變資料庫的管理方式資料庫
- Kubernetes 將徹底改變企業資料庫管理? - thenewstack資料庫
- 為什麼開源資料庫改變許可證?資料庫
- [20230224]改動資料檔案小技巧.txt
- win10怎麼改microsoft名字 win10系統microsoft名字如何改Win10ROS
- [20211015]centos 7改變runlevels使用systemctl.txtCentOS
- [20210428]資料庫連線加密.txt資料庫加密
- 大資料帶來了哪些改變大資料
- Oracle、mysql資料庫增、刪、改OracleMySql資料庫
- [20181203]改變檔案大小與檢查點.txt
- [20180316]改變oracle使用者口令時限.txtOracle
- 雲端計算時代,資料庫架構設計有哪些改變?資料庫架構
- [20200102]資料庫安裝問題.txt資料庫
- [20210529]延遲開啟資料庫.txt資料庫
- [20180529]克隆資料庫與dblinks注意.txt資料庫
- 人工智慧將如何改變資料安全人工智慧
- 織夢資料庫裡改密碼資料庫密碼
- 明解資料庫------資料庫儲存演變史資料庫
- 五筆:鍵名字練習.txt,250字
- [20181224]使用odbc連線oracle資料庫.txtOracle資料庫
- Python操作SQLServer資料庫增刪改查PythonSQLServer資料庫
- mogoose 建立資料庫並增刪改查Go資料庫
- 03-mysql資料庫怎刪改查MySql資料庫
- Flutter資料庫Sqflite之增刪改查Flutter資料庫
- [20211203]演示job啟動時間改變的情況.txt
- [20221128]dg資料庫最佳化問題.txt資料庫
- [20200814]8K資料庫最大行號.txt資料庫
- [20191227]別把資料庫當作垃圾場.txt資料庫
- [20181128]toad連線資料庫的問題.txt資料庫