">

Oracle Veritabanında db_name Değiştirme

Oracle Veritabanında db_name Değiştirme

 merhaba Arkadaşlar,

Oracle veritabanında db_name nasıl değiştirebilirizi anlatmaya çalışacağım;

DB_NAME'i ORCLL den ORCL yapacağız.

 

database kapatılır ve mount modda açılır.

 

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area  484392960 bytes

Fixed Size                    2254384 bytes

Variable Size                  201329104 bytes

Database Buffers          276824064 bytes

Redo Buffers                    3985408 bytes

 

Database mounted.

 

daha sonra aşağıdaki komut çalıştırılır

 

 

[oracle@localhost ~]$ nid target=sys/oracle dbname=ORCL

 

log olarak son satırda aşağıdaki gibi bir log gördüyseniz sorun yoktur.

 

Succesfully changed database name and ID.

 

DBNEWID - Completed succesfully.

 

 

Daha sonra veritabanına bağlanılır ve veritabanı nomount modda açılır.

 

[oracle@localhost ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Tue May 9 04:40:26 2017

 

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

 

Connected to an idle instance.

 

SQL> startup nomount;

ORACLE instance started.

 

Total System Global Area  484392960 bytes

Fixed Size                    2254384 bytes

Variable Size                  201329104 bytes

Database Buffers          276824064 bytes

Redo Buffers                    3985408 bytes

 

Nomount modda olan veritabanında aşağıdaki komut çalıştırılır ve db_name ORCL yapılır.

 

SQL> alter system set db_name=ORCL scope=spfile;

 

System altered.

 

Sonrasında veritabanı kapatılır mount modda açılır ve resetlog ile open edilir.

 

SQL> shutdown immediate;

ORA-01507: database not mounted

 

 

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area  484392960 bytes

Fixed Size                    2254384 bytes

Variable Size                  201329104 bytes

Database Buffers          276824064 bytes

Redo Buffers                    3985408 bytes

Database mounted.

 

SQL> alter database open resetlogs;

 

 

Database altered.

 

 

Son olarak password file değiştirilir.

 

[oracle@localhost ~]$ echo $ORACLE_HOME

/u01/app/oracle/product/11.2.0/db

[oracle@localhost ~]$ orapwd file=$ORACLE_HOME/dbs/orapwORCL.ora password=oracle entries=5;

[oracle@localhost ~]$ cd $ORACLE_HOME

[oracle@localhost db]$ cd dbs/

 

[oracle@localhost dbs]$ ls -ltr

 

Db_name değişmiş mi diye kontrol ederiz.

 

[oracle@localhost dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Tue May 9 04:42:38 2017

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> select dbid, name from v$database;

 

      DBID NAME

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

 

1471295265 ORCL

 

Listenerı reload ederek çalışmayı sonlandırırız.

 

[oracle@localhost ~]$ lsnrctl reload

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 09-MAY-2017 04:49:18

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

The command completed successfully

[oracle@localhost ~]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 09-MAY-2017 04:49:40

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                09-MAY-2017 04:37:47

Uptime                    0 days 0 hr. 11 min. 53 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "ORCL" has 1 instance(s).

  Instance "orcll", status READY, has 1 handler(s) for this service...

Service "orcllXDB" has 1 instance(s).

  Instance "orcll", status READY, has 1 handler(s) for this service...

The command completed successfully

 

[oracle@localhost ~]$ 

 

Umarım faydalı olmuştur...

 

 

Yorumlar

Henüz yorum yapılmadı.

Yorum Yapın