search
HomeDatabaseMysql Tutorial使用nib修改Oracle数据库名称

使用nib修改Oracle数据库名称,有两个方法:一是将controlfile 转出来,修改数据库名称重建;另一个是使用nib 工具修改。我这里介

有两个方法:一是将controlfile 转出来,修改数据库名称重建;另一个是使用nib 工具修改。我这里介绍nib 工具修改操作方法。

工具nib 是Oracle 9i 开始提供的,专门用于修改数据库名称。

第一步,备份整库。

因为这种操作会有可能失败,所以必须要先备份。

第二步,将库正常关闭,再启动到mount 状态。

第三步,使用nib 修改数据库名称

修改命令为  nid target=sys/welcome1 dbname=webdb

修改完成后,,提示数据库已经关闭,需要使用open resetlogs 方式打开。

第四步,打开数据库。

打开之前,需要新生成符合新数据库名称的初始化参数文件和密码文件。监听器文件也需要做针对性修改。

/u04/webdb_rman@db3=>webreader$nid target=sys/welcome1 dbname=webdb
DBNEWID: Release 10.2.0.4.0 - Production on Tue May 15 11:43:33 2012
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to database WEBREADER (DBID=4271057885)
Connected to server version 10.2.0
Control Files in database:
+VG1/webdb/control01.ctl
+VG1/webdb/control02.ctl
+VG1/webdb/control03.ctl
Change database ID and database name WEBREADER to WEBDB? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 4271057885 to 2506031974
Changing database name from WEBREADER to WEBDB
Control File +VG1/webdb/control01.ctl - modified
Control File +VG1/webdb/control02.ctl - modified
Control File +VG1/webdb/control03.ctl - modified
Datafile +VG1/webdb/system01.dbf - dbid changed, wrote new name
Datafile +VG2/webdb/data_salebill05.dbf - dbid changed, wrote new name
Datafile +VG1/webdb/sysaux01.dbf - dbid changed, wrote new name
Datafile +VG1/webdb/users01.dbf - dbid changed, wrote new name
Datafile +VG1/webdb/undotbs02.dbf - dbid changed, wrote new name
………………………
Instance shut down
Database name changed to WEBDB.
Modify parameter file and generate a new password file before restarting.
Database ID for database WEBDB changed to 2506031974.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.

/u04/webdb_rman@db3=>webreader$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 15 11:42:04 2012
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5.1540E+10 bytes
Fixed Size                  2179936 bytes
Variable Size            6425676960 bytes
Database Buffers         4.5097E+10 bytes
Redo Buffers               14594048 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

/u04/webdb_rman@db3=>webreader$export ORACLE_SID=webdb
/u04/webdb_rman@db3=>webdb$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 15 11:44:47 2012
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5.1540E+10 bytes
Fixed Size                  2179936 bytes
Variable Size            6425676960 bytes
Database Buffers         4.5097E+10 bytes
Redo Buffers               14594048 bytes
Database mounted.
SQL> show parameter db_name
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      webdb
SQL> alter database open resetlogs;
Database altered.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +VG2
Oldest online log sequence     1
Next log sequence to archive   1
Current log sequence           1
SQL>

更多Oracle相关信息见Oracle 专题页面 ?tid=12

linux

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to solve the problem of mysql cannot open shared libraryHow to solve the problem of mysql cannot open shared libraryMar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

Reduce the use of MySQL memory in DockerReduce the use of MySQL memory in DockerMar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin)Run MySQl in Linux (with/without podman container with phpmyadmin)Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overviewWhat is SQLite? Comprehensive overviewMar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Running multiple MySQL versions on MacOS: A step-by-step guideRunning multiple MySQL versions on MacOS: A step-by-step guideMar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.