Change Bank Sid

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
diegolenhardt
Moderador
Moderador
Posts: 1177
Joined: Thu, 15 Oct 2009 10:28 am
Location: Recife

Environment information:
* Oracle version: 10
* Operating system: OEL5

aí Personal, Someone has some How-to to change the SID from one bank
I was seeing a nid utilitario, I do not know if I did wrong or not but, it did not work,

I want to clone the production environment to create a development environment, with RMAN,

Duplicate will create in the same machine, I want to create in different machines,

How would it be?
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

NID
DBNEWID IS A DATABASE UTITY THER CAN CHANGE THE INTERNAL DATABASE Identifier (DBID) and The Database Name (DBNAME) for an operational database.

Prior to The Introduction of the Dbnewid Utility, You Could Manually Create A Copy of a Database and Give It A New Database Name (DBNAME) by re-creating the Control File. However, You Could Not Give The Database to New Identifier (DBID). The DBID is an Internal, Unique Identifier for Database. Because Recovery Manager (RMAN) Distinguishes Databases by dbid, You Could Not register to Seed Database and A Manually Copied Database Together in the Same Rman Repository. The Dbnewid Utility Solves This problem by allowing you to Change any of the following:

* Only the dbid of a database
* Only the dbname of a database
* Both the dbname and dbid of database

Changing the dbid of a Database is a Serious procedure. When the dbid of a database is changed, all priuous backups and archived logs of the database unusable becoming. After you Change The DBID, You Must Open The Database with the Resetlogs Option, What Re-Createes The Online Logs and Resets The Oracle9i Database Administrator's Guide). Consequently, You Should Make A Backup of the Whole Database Immediately After Changing The DBID.

Changing The DBName Without Changing The DBID Does Not Required You To Open With The Resetlogs Option, OS Database Backups and Archived Logs Are Not Invalidated. However, Changing The DBName Does Have Consequences. You Must Change The DB_Name Initialization Parameter After Database Name Change to Reflect The New Name. ALSO, YOU MAY HAVE TO RE-CREATE THE ORACLE PASSWORD FILE. If you restore an Old Backup of the Control File (BEFORE THE NAME CHANGE), Then You Should Use The Initialization Parameter File and Password File from Before The Database Name Change.
Syntax:
Keyword Description Default
Target UserName / Password None
DBName New Database Name None
LogFile Output Log None

Revert Revert Failed Change in
SetName Set to New Database Name Only in
Append Append to Output Log in
Help DISPLAYS HELP MESSAGES in
/ *
Ensure that you have a Recoverable Whole Database Backup and Ensure that The Target database is mounted but not open, and that it it was shut down consistently prior to mounting.
* /

Select all

SHUTDOWN IMMEDIATE 
STARTUP MOUNT
/ * Invoke The DBNewid Utility on the Command Line, Specifying to Valid User With the Sysdba Privilege.
* /

Select all

% nid TARGET=sys/oracle@test_db
/ *
To Change The Database Name In Addition To The DBID, Specify The DBName Parameter.
This Example Changes The Name To Orabase:
* /

Select all

% nid TARGET=sys/oracle@test DBNAME=orabase
/ *
The dbnewid Utility Performs Validations in The Headers of the Datafiles and Control Files Before Attempting I / O To The Files. IF validation is successful, then dbnewid prompts you to confirm the operation (unless you specify the log file, in which case it does not prompt), changes the dbid for each datafile (including offline normal and read-only datafiles), and then exits . The Database is Left Mounted But Is Not Yet Usable.
* /

Select all

DBNEWID: Release 10.2.0.1.0 
 
(c) Copyright 2005 Oracle Corporation. All rights reserved. 
 
Connected to database TEST_DB (DBID=3942195360)
Control Files in Database:
/ Oracle / DBS / CF1.f
/oracle/dbs/cf2.f

Change Database ID of Database Solaris? (Y / [n]) => Y

Proceeding with Operation
Datafile /oracle/dbs/Tbs_01.f - Changed
Datafile / Oracle / DBS / TBS_02.f - Changed
Datafile /oracle/dbs/tbs_11.f - Changed
Datafile /oracle/dbs/tbs_12.f - Changed
Datafile / Oracle / DBS / TBS_21. F - Changed [/ Code]

/ *
New DBID for Database Test_db is 3942196782.
ALL Previous Backups and Archived Red Logs for this database are unusable
Proceed to Shutdown Database and Open with resetlogs Option.
DBNewid - Database Changed.

IF Validation is Not successful, Then DBNewid Terminates and Leaves The Target Database Intact. You can open the database, fix the error, and then eithe summaries the dbnewid operation or continuation using the database without changing its dbid.
After DBNewid SuccessFully Changes The DBID, Shut Down The Database




- Mount The Database

Select all

STARTUP MOUNT
- Open The Database in Resetlogs Mode and Resume Normal Use

Select all

ALTER DATABASE OPEN RESETLOGS;
/ *
Make a New Database Backup. Because You Reset The Online Logs, The Old Backups and Archived Logs Are No Longer Usable In The Current Incarnation Of The Database.
* /
/ *
The Following Steps Describe How to Change The Database Name Without Changing The DBID.

1. Ensure that you have the Recoverable Whole Database Backup.
2. Ensure that the target database is mounted but not open, and that it was shut down consistently prior to mounting.
* /

Select all

SHUTDOWN IMMEDIATE 
STARTUP MOUNT
/ *
3. Invoke The Utility On The Command Line, Specifying to Valid User With the Sysdba Privilege. You Must Specify Both The DBName and Setname Parameters. This Example Changes The Name To Orabase:
* /

Select all

% nid TARGET=SYS/oracle@test_db DBNAME=orabase SETNAME=YES
/ *
DBNewid Performs Validations in The Headers Of The Control Files (NOT THE DATAFILES) BEFORE ATTEMPTING I / O TO THE FILES. IF Validation is successful, then dbnewid Prompts for Confirmation, Changes The Database Name in the Control Files, and EXITS. After DBNewid Completes SuccessFully, The Database is Left Mounted But Is Not Yet Usable.
* /

Select all

DBNEWID: Release 10.2.0.1.0 
 
(c) Copyright 2005 Oracle Corporation. All rights reserved. 
 
Connected to database TEST_DB (DBID=3942196782) 
 
Control Files in database: 
/oracle/dbs/cf1.f 
/oracle/dbs/cf2.f 
 
Change database name of database TEST_DB to ORABASE? (Y/[N]) => Y 
 
Proceeding with operation 
 
Database name changed from TEST_DB to ORABASE - database needs to be 
shutdown. 
Modify parameter file and generate a new password file before restarting. 
 
DBNEWID - Successfully changed database name
/ *
IF Validation is Not successful, Then DBNewid Terminates and Leaves The Target Database intact. You can open the database, fix the error, and then either resume the dbnewid operation or continuation using the database without changing the database name.
4. Shut down the database.
* /

Select all

SHUTDOWN IMMEDIATE
/ *
5. Set The DB_Name Initialization Parameter in the Initialization Parameter File to The New Database Name.
6. Create the New Password File.
7. Start Up The Database and Resume Normal Use.
* /

Select all

STARTUP

http://en.glufke.net/oracle/viewtopic.php?t=2889
pedroedu
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 50
Joined: Wed, 10 Feb 2010 3:04 pm
Location: são Luis
Oracle Database 10g/12c Administrator Certified Professional
Oracle Database 11g Security
ISFS Information Security Foundation based on ISO IEC 27001
ITIL® Foundation V3 in IT Service Management

simple and easy, after restoring the bank with the same name, you change the SID in the init, in the variable oracle_sid and recreates the controlling with the trace, you should know what I'm talking about, inside the trace (generated by the command alter database backup controlfile to trace as '/tmp/coltrolfile.txt') Changes the SID:

Select all

CREATE CONTROLFILE REUSE SET DATABASE [b]SID_NOVA[/b] NORESETLOGS ARCHIVELOG 
After recreating the ControlFile you will run the alter database open and ProOoonto. : Wink:
annubiss
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 26
Joined: Fri, 05 Feb 2010 12:43 pm
Location: RS

What would be Sid of the bank exactly?

type a name on which you will use to connect?
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

The Oracle System ID (SID) is used to uniquely identify the particular database on a system. For this Reason, One Cannot has more than One Database with the SAME SID ON COMPUTER SYSTEM.

When USING RAC, ALL INSTANCES Belonging to The Same Database Must Have Unique Sid's.
annubiss
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 26
Joined: Fri, 05 Feb 2010 12:43 pm
Location: RS

I did ... vlw man!
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests