database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Tutorials 8771 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 8771
DB 이름과 오라클 SID 를 변경하는 방법
작성자
정재익(advance)
작성일
2001-12-08 01:25
조회수
8,394

Modifying a database to run under a new ORACLE_SID

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

 

1. Shutdown instance

 

2. Backup all control, redo and data files.

 

3. Go thru the .profile, .cshrc, .login, oratab, tnsnames.ora(for net v2)

, and redefine the environment variable ORACLE_SID to a new value.

ie search thru disks and do a grep ORACLE_SID *

 

4. cd $ORACLE_HOME/dbs and rename the following files:

o init.ora (or use pfile to point to the init file.)

o control file(s) This is optional if you don't rename any of the

controlfiles, and the control_files parameter is

used. control_files would be set in the initSID.ora

file or in a file it references with the ifile

parameter. Make sure control_files doesn't point to

any old file names, if you renamed them.

o crdb.sql & crdb2.sql This is optional. These are

only used at database creation.

 

5. cd $ORACLE_HOME/rdbms/admin and rename the file:

o startup.sql This is optional.

(On some platforms, this file may be in $ORACLE_HOME/rdbms/install.)

Make sure the contents of this file do not reference old initSID.ora

files that have been renamed. This file simplifies the process to

"startup exclusive" your database.

 

6. To rename the database files and redo log files, you would follow the

instructions in the bulletin: 98863.723.

 

7. Change the ORACLE_SID environment variable to the new value.

 

8. start up database and verify it works. Once you have done this,

shutdown the database and take a final backup of all control, redo and

data files.

 

9. When the instance is started, the control file gets updated with the

current ORACLE_SID.

 

 

Changing the dbname for a database

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

 

1. sqldba

 

2. connect internal

 

3. alter database backup controlfile to trace;

This will write in a trace file, the CREATE CONTROLFILE command that

would recreate the controlfile as it currently exists.

 

4. Exit and go to the directory where your trace files are located.

They are usually in the $ORACLE_HOME/rdbms/log directory.

If user_dump_dest is set in the initSID.ora, then go to the directory

listed in the user_dump_dest variable.

The trace file will have the form "ora_NNNN.trc with NNNN being a

number.

 

5. Get the CREATE CONTROLFILE command from the trace file and put it in

a new file called something like ccf.sql.

 

6. Edit the ccf.sql file and modify the CREATE CONTROLFILE command.

Just change the word "REUSE" to "SET",and "NORESETLOGS" to

"RESETLOGS", and modify the dbname.

Old line:

CREATE CONTROLFILE REUSE DATABASE "olddbname" NORESETLOGS ...

New line:

CREATE CONTROLFILE set DATABASE "newdbname" RESETLOGS ...

Then save the ccf.sql file.

 

7. Rename the old control files for backup purposes and so they are not

in the way of creating the new ones.

 

8. Edit initSID.ora so that db_name="newdbname".

 

9. sqldba

 

10. connect internal

 

11. startup nomount

 

12. @ccf

 

13. alter database open;

 

14. Make sure the database is working. Shutdown and backup the database.

 

- Oracle Korea Customer Support Technical Bulletins를 참조했습니다.

 

원본출처 : http://www.proserver.co.kr/bbs/bbs_view.php?bbs_name=dba_tip&action=view&bbs_id=12&pg=9&cv=&sf=&sd=&sw=&ps=&pe=

[Top]
No.
제목
작성자
작성일
조회
8827Oracle 8 - SQL & PL/SQL (2)
정재익
2001-12-11
15399
8825Oracle 8 - SQL & PL/SQL (1)
정재익
2001-12-11
14599
8772특정 TABLE을 다른 TABLESPACE로 옮기는 방법 [1]
정재익
2001-12-08
5232
8771DB 이름과 오라클 SID 를 변경하는 방법
정재익
2001-12-08
8394
8770OPS 란 - 간략한 개요
정재익
2001-12-08
8156
8769OS 명령으로 DATAFILE을 삭제한 경우:ORA-1157,1110
정재익
2001-12-08
5533
8768오라클 데이터베이스 생성방법
정재익
2001-12-08
14443
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2022 DSN, All rights reserved.
작업시간: 0.125초, 이곳 서비스는
	PostgreSQL v13.3으로 자료를 관리합니다