Oracle 9i Database Migration process

Source: Internet
Author: User
Tags copy file system log modify sqlplus
oracle| Process | data | database
Oracle 9i Database Migration process

Author: unknown


Database movement, often occurs during the implementation of a project, and for experienced DBAs, database movement is very easy. But for some people who only know the system and are not very knowledgeable about the database, Oracle's move is less than capacity.
For example, when the system is installed, storage space expands, need to move to the original Oracle, need to move data. Previously, it was possible to move in oracle8i for WINDOWS 2000. Now how does oracle9i for AIX 5L move??? In fact, on a variety of different platforms, the operation process is exactly the same.
Copying and moving data files
1), access to database-related information
First, look at the file contents of the database:
Sqlplus "/As SYSDBA"
? SELECT * from V$datafile;
? SELECT * FROM V$controlfile
? SELECT * from V$logfile;
2), mobile Application Data files
Shutdown immediate closes the database and copies the data files to a different directory. The files that need to be copy are:
System01.dbf
Indx01.dbf
Temp01.dbf
Users01.dbf
Apply data files

3), modify the location of the database files
Start Mount mode
? startup Mount;
? Alter DATABASE rename file ' \oracle\oradata\ocp ystem01.dbf ' to ' \ORADATA\OCP ystem01.dbf '
? Alter DATABASE rename file ' \oracle\oradata\ocp\indx01.dbf ' to ' \oradata\ocp\indx01.dbf ';
Note Database files that can only be changed to move, excluding control files and log files, temp files.
Two Move control file

(1) The contents of the backup SPFile:
To restart the database:
? Startup
? Create pfile= ' C:\init.ora ' from SPFile;
(2) Modify the contents of the Init.ora file:
*.control_files= ' \oradata\ocp\control01.ctl ', ' \oradata\ocp\control02.ctl ', ' \oradata\ocp\control03.ctl '
Make changes to the directory location that has been replicated.
Shutdown Database
(3) Copy the control file to the past,
Move three control files to the directory that is modified above.
(4) pour in the parameter file
Start in Init.ora parameter mode:
? Startup pfile= ' \oracle\init.ora ';
? Create SPFile from pfile= ' \oracle\init.ora ';
? Shutdown immediate;
? Startup Start from the SPFile.
This is the end of the control file movement work.
Third, rebuild or relocate log files
There are two ways to resolve log files, one is to move (rename) and the other is to recreate them.
(1) Move log file
Moving the database files is the same as moving the system database files, but requires that the database be "startup Mount".
? Startup Mount
? Alter DATABASE rename file ' \oracle\oradata\oralog1.ora ' to ' \oradata\ocp\oralog1.dbf '
Sample
(2) Rebuilding log files
First rebuild a group and add a log file as the swap file.
ALTER DATABASE ADD LOGFILE GROUP 4 (' $HOME/oradata/u01/log4.rdo ', ' $HOME/oradata/u02/log4.rdo ') SIZE 1M;
Then delete the other log groups, requiring that two log filegroups be kept in the system.
Alter database Drop logfile member ' \oracle\oradata\ocp\oralog01.ora '

Iv. reconstruction of the system of supervisory (temp) file system

The temp file cannot be moved while the datasheet space is being moved, requiring that a temp tablespace be rebuilt and set to the system default temp file system. And then the book in addition to the original temp table space, to move the table space process.
> Create temporary tablespace "temp02" Tempfile ' \oradata\ocp\temp02.dbf ' size 500m extent management local uniform siz e 10m;
Then you can delete the original temp file.

V. Test database
To restart Oracle data
$ sqlplus "/as sysdba"
? Startup
? Show SGA;
?



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.