How does oracle12C change dbname ?, Oracle12cdbname

Source: Internet
Author: User

How does oracle12C change dbname ?, Oracle12cdbname

Oracle 12.2.0.1: A control file trace:

Alter database backup controlfile to trace;

Oradebug setmypid;

Oradebug tracefile_name;

Obtain the script for creating the control file based on the trace file.

Create an initATPuat. ora file first:

Create pfile = '/ATPapp/oraATP/home/initATPuat. ora' from spfile;

Change ATP in initATPuat. ora to ATPuat, and change ORACLE_SID in. bash_profile of OS oracle to ATPuat.

Start with pfile to nomount status

Go to asmcmd and delete the original control file.

SQL> show parameter db_create

NAME TYPE VALUE

-----------------------------------------------------------------------------

Db_create_file_dest string + ATPDG1

Db_create_online_log_dest_1 string

Db_create_online_log_dest_2 string

Db_create_online_log_dest_3 string

Db_create_online_log_dest_4 string

Db_create_online_log_dest_5 string

If only db_create_file_dest has a value, ORACLE will create two control files in the db_create_file_dest directory.

Reorganize the control file after changing the database name as follows:

Create controlfile set DATABASE "ATPUAT" RESETLOGS NOARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 1024

MAXINSTANCES 8

# MAXLOGHISTORY 292

LOGFILE

GROUP 1 (

'+ ATPDG1/ATP/ONLINELOG/group_1.259.965469981 ',

'+ ATPDG1/ATP/ONLINELOG/group_1.260.965469981'

) SIZE 200 m blocksize 512,

GROUP 2 (

'+ ATPDG1/ATP/ONLINELOG/group_2.261.965469983 ',

'+ ATPDG1/ATP/ONLINELOG/group_2.262.965469983'

) SIZE 200 m blocksize 512,

GROUP 3 (

'+ ATPDG1/ATP/ONLINELOG/group_3.263.965469985 ',

'+ ATPDG1/ATP/ONLINELOG/group_3.264.965469985'

) SIZE 200 m blocksize 512

-- STANDBY LOGFILE

DATAFILE

'+ ATPDG1/ATP/DATAFILE/system.265.965469987 ',

'+ ATPDG1/ATP/62C80FC16441609AE053B05A100A2C8B/DATAFILE/system.266.965469991 ',

'+ ATPDG1/ATP/DATAFILE/sysaux.267.965469997 ',

'+ ATPDG1/ATP/62C80FC16441609AE053B05A100A2C8B/DATAFILE/sysaux.268.965469999 ',

'+ ATPDG1/ATP/DATAFILE/undotbs1.269.965470001 ',

'+ ATPDG1/ATP/62C80FC16441609AE053B05A100A2C8B/DATAFILE/undotbs1.270.965470001 ',

'+ ATPDG1/ATP/DATAFILE/users.273.965470023 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/system.275.965475081 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/sysaux.277.965475081 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/undotbs1.276.965475081 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/users.279.965475379 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/dbo_webiplined.280.965554337 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/dbo_webiplinex.281.965554411 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/gpatd.282.965555729 ',

'+ ATPDG1/ATP/62C93F2857BF4ECDE053B05A100ABBE6/DATAFILE/gpatx.283.965555849'

Character set AL32UTF8 ;;

The following error is reported:

Create controlfile set DATABASE "ATPUAT" RESETLOGS NOARCHIVELOG

*

ERROR at line 1:

ORA-01503: create controlfile failed

ORA-00200: control file cocould not be created

ORA-00202: control file: '+ ATPDG1/ATP/CONTROLFILE/current.257.965469981'

ORA-17502: ksfdcre: 4 Failed to create file

+ ATPDG1/ATP/CONTROLFILE/current.257.965469981

ORA-15046: ASM file name' + ATPDG1/ATP/CONTROLFILE/current.257.965469981 'is

Not in single-file creation form

Close the DB and mark the following line in the initATPuat. ora file:

# *. Control_files = '+ ATPDG1/ATP/CONTROLFILE/current.257.965469981', '+ ATPDG1/ATP/CONTROLFILE/current.258.965469981'

Start the database to the nomount status and re-establish the control file;

Create the spfile back to the ASM disk group:

Create spfile = '+ ATPdg1' from memory;

Rename the original spfile under $ ORACLE_HOME/dbs, and set and modify the initmdpuat. ora content to point to the spfile of the ASM Disk:

Cd $ ORACLE_HOME/dbs

Vi initATPuat. ora

Spfile = '+ ATPdg1/ATPuat/PARAMETERFILE/spfile.284.96520.549'

Run: alter database open resetlogs

Select name, open_mode from v $ pdbs;

Check whether cdb is in read only state, and pdb is in mount state, and then open pdp:

Alter session set container = ATPuap;

Startup

To enable the next pdb to start with cdb at a time, run the following command in cdb:

Alter pluggable database pdb name save state

Finally, register the following information:

Change db_unique_name to ATPuat in OCR as follows:

1. Stop the database and remove the database from ocr

Srvctl remove database-d ATP

2. Add database resources at the cluster level

Srvctl add database-d ATPuat-n ATPuat-o/ATPapp/orapat/12.2.0

3. Modify the dependency between the database and the asm disk in ocr.

Srvctl modify database-d ATPuat-a "ATPDG1"

4. register the service again (if necessary)

Su-Beijing pl

Srvctl add service-d nhcpl-s BMP l-r bpmpl1-a bpmpl2-P basic-e select-m basic

Srvctl add service-d nhcpl-s bdmr-r bpmpl2-a bpmpl1-P basic-e select-m basic

Start service

Srvctl start service-d nhcpl-s BMP L

Srvctl start service-d nhcpl-s bdmr

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.