iSelfSchooling.com - Copyright © 1999-2007 iSelfSchooling.com  References  Job Openings  |  Secure Login
    Home  | Search more...  |  FREE Online VIDEO Oracle Training  |  Gift Store  |  Bookstore

   Unlimited access!   

    Oracle  Syntax  | Suggestions Your Contribution  |  FREE Legal Forms

 

Email2aFriend Homepage us! |  Bookmark   -  Copyright & User Agreement

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 Bookstore

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

FREE Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

BASICS

SQL | PL/SQL

DEVELOPERS

FORMS 2 | REPORTS | Other TOOLS

DBAs

FUNDAMENTALS 2 | PERFORMANCE | OEM

ADVANCE

APPLICATION SERVER | GRID CONTROL | ARTICLES 2 3 4

Advanced - Articles III

Lesson 01 | Lesson 02 | Lesson 03 | Lesson 04 | Lesson 05 | Lesson 06 | Lesson 07 | Lesson 08 | Lesson 09 | Lesson 10 | Lesson 11 | Lesson 12 | Lesson 13 | Lesson 14 | Lesson 15 | Lesson 16 | Lesson 17 | Lesson 18 | Lesson 19 | Lesson 20 | Lesson 21 | Lesson 22 | Lesson 23 | Lesson 24 | Lesson 25 | Lesson 26 | Lesson 27 | Lesson 28 | Lesson 29 | Lesson 30 | Lesson 31 | Lesson 32 | Lesson 33 | Lesson 34 | Lesson 35 |

Lesson 10

"What befalls the earth befalls all the sons of the earth. This we know: the earth does not belong to man, man belongs to the earth. All things are connected like the blood that unites us all. Man does not weave this web of life. He is merely a strand of it. Whatever he does to the web, he does to himself."

-Chief Seattle (1786-1866)

How to change or rename a database name
 
The following are steps to rename a database name:
1. Login to sqlplus and backup the controlfile to trace.
$ sqlplus /nolog
$ SQL> connect / as sysdba
$ SQL> alter database backup controlfile to trace;
 
2. Shutdown your databse.
$ SQL> connect / as sysdba
$ SQL> shutdown immediate;
 
3. Copy the content of your backup controlfile to a file and
call it "rename-my-database.sql" or rename it.
 
4. Rename all your controlfiles.
$ mv /u02/oradata/mydb/control_01 .ctl /u02/oradata/mydb/control_01 .ctl.old
$ mv /u03/oradata/mydb/control_02 .ctl /u03/oradata/mydb/control_02 .ctl.old
Rename all your controlfiles you have. To find their location, do the following:
$ SQL> connect / as sysdba
$ SQL> select name from v$controlfile;
NAME
------------------------------ ------------------------------ --------------------
/u06/oradata/mydb/control01.ctl
/u02/oradata/mydb/control02.ctl
/u03/oradata/mydb/control03.ctl
 
5. Change the folloing parameter in your CREATE CONTROLFILE statement.
you may have something like this:
CREATE CONTROLFILE REUSE DATABASE "mydb" NORESETLOGS ARCHIVELOG
changs:
CREATE CONTROLFILE SET DATABASE "mynewdb" RESETLOGS ARCHIVELOG
 
6. Make sure your init file points to your new database and instance.
*.db_name='mynewdb'
*.instance_name='mynewdb'
 
7. Connect to sqlplus as sysdba and then run the "rename-my-database.sql" script.
$ SQL> connect / as sysdba
$ SQL> startup nomount pfile= init.ora
$ SQL> @rename-my-database.sql
 

How to clone a database from my server to another to a different server
 
The following are steps to clone a database from one server to another:
1. Login to sqlplus and backup the controlfile to trace, data files,
tempfile, and redolog files.
$ sqlplus /nolog
$ SQL> connect / as sysdba
$ SQL> alter database backup controlfile to trace;
SQL> select name from v$datafile;
NAME
------------------------------ -------------------
/u04/oradata/mydb/system01.dbf
/u04/oradata/mydb/indx01.dbf
...
SQL> select member from v$logfile;    
MEMBER
------------------------------ -------------------
/u02/oradata/servicet/redo03 .log
/u02/oradata/servicet/redo02 .log
...
SQL> select name from v$tempfile;
NAME
------------------------------ -------------------
/u02/oradata/servicet/temp01 .dbf
 
Now, you can shutdown down your database and do your cold backup.
$ SQL> connect / as sysdba
$ SQL> shutdown immediate
Copy all above files to your remote server and locat host where you want to
have your clone.
Then, start your database.
$ SQL> connect / as sysdba
$ SQL> startup
 
2. Shutdown your database.
$ SQL> connect / as sysdba
$ SQL> shutdown immediate;
 
3. Now, you can repeat the process the same as renaming a database.

 

 

 

 
 
Google
 
Web web site