Use dbms_backup_restore to modify DBID

Source: Internet
Author: User

When dbms_backup_restore is used to modify the DBID database, what else cannot be modified? In some special circumstances, we may need to modify the DBID of the database, and sometimes it may only be modifying the control file. Starting from Oracle10g, Oracle added several PROCEDURE in the DBMS_BACKUP_RESTORE package to complete this task. The related processes are PROCEDURE NIDBEGINArgument Name Type In/Out Default? Invalid parameters ------ -------- NEWDBNAME VARCHAR2 INOLDDBNAME VARCHAR2 innewdbid number inolddbid number indorevert BINARY_INTEGER INDORESTART BINARY_INTEGER inevents number inprocedure nidendprocedure specified Name Type In/Out Default? ------------------------------ --------------------- ------ -------- DBNAME VARCHAR2 inndbid number outprocedure NIDPROCESSCFArgument Name Type In/Out Default? When ----------------------- ------ CHGDBID BINARY_INTEGER OUTCHGDBNAME BINARY_INTEGER OUT by the way, if you encounter a database DBMS_BACKUP_RESTORE does not exist: SQL> DESC DBMS_BACKUP_RESTOREERROR: ORA-04043: the DBMS_BACKUP_RESTORE object does not exist. You can run $ ORACLE_HOME/rdbms/admin/dbmsbkrs. SQL to create! You can modify the DBID of a database using the newly added SQL statements. The following is a test procedure: C: \> sqlplus "/as sysdba" SQL * Plus: release 10.2.0.3.0-Production on Wednesday May 21 22:10:17 2008 Copyright (c) 1982,200 6, Oracle. all Rights Reserved. connect to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0-ProductionWith the Partitioning, OLAP and Data Mining options SQL> alter database open; the Database has been changed. SQL> select dbid from v $ database; DBID----------1465764760 SQL> show parameter db_name name type value values ---------------------------------------- db_name string eygle SQL> exec values ('eygl', 'eygl ', the PL/SQL process is completed successfully. SQL> select dbid from v $ database; DBID----------1465764760 SQL> variable a number; SQL> variable B numberSQL> variable c number; SQL> exec dbms_backup_restore.nidprocessdf (,: a,: B ,: c); the PL/SQL process has been completed successfully. SQL> print: a A ---------- 0 SQL> print: B B ---------- 1 SQL> print: c C ---------- 1 SQL> exec dbms_backup_restore.nidprocesscf (: a,: B ); the PL/SQL process is successfully completed. SQL> print: a A ---------- 1 SQL> print: B B ---------- 1 SQL> exec dbms_backup_restore.nidend; the PL/SQL process has been completed successfully. SQL> select dbid from v $ database; the DBID----------3935589514 completes the modification at this time, it is best to restart the database once, so that the modification is confirmed. -The End-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.