metin ergöktaş oracle blog

Oracle Database SID değiştirme

Posted in Administration by itmanager on 16 Nisan 2010

DBNEWID kullanmadan veritabanının SID sini değiştirmenin tek yolu controfile ların yeniden oluşturulmasıdır. Şimdi varolan bir veritabanımızın (SEKER) ismini ve SID sini değiştirecez. Yeni SID VE db_name (BORDRO) olacak.

Öncelikle varitabanımızı clean shutdown dediğimiz bir metotla kapatmamız gerekiyor

Shutdown immediate

MOUNT modda yeniden başlatıyoruz.
Windows komut satırına geçip aşağıdaki dbnewid aracını aşağıdaki parametrelerle çalıştırıyoruz.

nid TARGET=sys/syssifresi@192.168.10.103/seker DBNAME=bordro

eğer target veritabanımıza (SEKER) bağlanmada bir problem olmazsa aşağıdaki çıktıyı görmemiz gerekiyor. Dikkat edilirse hedef veritabanına bağlandıktan sonra SID ve veritabanı isim değişikliği için bizden onay istiyor.

DBNEWID: Release 10.2.0.1.0 - Production on Fri Apr 16 15:01:29 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to database SEKER (DBID=10687593)

Connected to server version 10.2.0

Control Files in database:
C:\SEKERDB\CONTROL01.CTL
C:\SEKERDB\CONTROL02.CTL
C:\SEKERDB\CONTROL03.CTL

Change database ID and database name SEKER to BORDRO? (Y/[N]) => y

Proceeding with operation
Changing database ID from 10687593 to 1061216394
Changing database name from SEKER to BORDRO
Control File C:\SEKERDB\CONTROL01.CTL – modified
Control File C:\SEKERDB\CONTROL02.CTL – modified
Control File C:\SEKERDB\CONTROL03.CTL – modified
Datafile C:\SEKERDB\SYSTEM01.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\UNDOTBS01.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\SYSAUX01.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\USERS01.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_DATA.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_INDEX.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_LOB.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_REPORT_DATA.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_REPORT_INDEX.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_ARCHIVE_DATA.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_ARCHIVE_INDEX.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_DATA2.DBF – dbid changed, wrote new name
Datafile C:\SEKERDB\IFSAPP_INDEX2.DBF – dbid changed, wrote new name
Control File C:\SEKERDB\CONTROL01.CTL – dbid changed, wrote new name
Control File C:\SEKERDB\CONTROL02.CTL – dbid changed, wrote new name
Control File C:\SEKERDB\CONTROL03.CTL – dbid changed, wrote new name
Instance shut down

Database name changed to BORDRO.
Modify parameter file and generate a new password file before restarting.
Database ID for database BORDRO changed to 1061216394.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID – Completed succesfully.

Son kısımdaki uyarıları dikkatle okumak gerekiyor.

Önce yaptığımız değişikliği başlangıç dosyalarına uygulamak için sırasıyla

STARTUP MOUNT
ALTER SYSTEM SET DB_NAME=BORDRO SCOPE=SPFILE;
SHUTDOWN IMMEDIATE

Komutlarını çalıştıralım

Son olarak veritabanını RESETLOGS ile başlatmamız gerekiyor

ALTER DATABASE OPEN RESETLOGS

Şununla etiketlendi:, , , , ,

2 Yanıt

Subscribe to comments with RSS.

  1. umit said, on 22 Nisan 2010 at 9:39 pm

    Peki Hocam
    Oracle de SID , SERVICE NAME, GLOBAL DATABASE NAME kavramlarını birinden farklandiran nedir? Oracle_sid ile global database name aynı şey mi?

    Kolay gelsin….

  2. metinergoktas said, on 24 Nisan 2010 at 12:02 am

    burada
    http://www.adp-gmbh.ch/ora/misc/identifiers.html
    http://www.lazydba.com/oracle/0__91510.html
    detaylı açıklamalar mevcut, kolay gelsin..


Yorum yapın

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Değiştir )

Twitter picture

You are commenting using your Twitter account. Log Out / Değiştir )

Facebook photo

You are commenting using your Facebook account. Log Out / Değiştir )

Connecting to %s

Follow

Get every new post delivered to your Inbox.