Install Linux Oracle on server B

Source: Internet
Author: User

C. After a long period of development, I would like to express my personal understanding here. Here we will talk about Linux Oracle. Sometimes we encounter such a situation where the existing database needs to be transferred from one machine to another. Generally, we use export and import. However, if the database contains a large amount of data and the size of the data file is large, problems may occur during the export and import process, and we cannot tolerate the long process.

In this case, we can simply use the copy command of the operating system to directly transfer the database. The following example applies to Linux Oracle9.2.0.1 on Redhat Fedora Core 1. Other operating systems and Linux Oracle versions are also applicable.

Assume that our database is on server A, $ Linux Oracle_BASE is/Linux Oracle, and $ Linux Oracle_HOME is/Linux Oracle/product/9.2.0. Now we want to transfer this database to server B, and the new $ Linux Oracle_BASE is/u01/Linux Oracle, and $ Linux Oracle_HOME is/u01/Linux Oracle/product/9.2.0. The SID is oralinux.

The procedure is as follows:

1. install Linux Oracle on server B,

Do not create databases during installation. The user's profile can be copied directly from server A. Note that you need to modify the original $ Linux Oracle_HOME location to the current location.

2. if Linux Oracle on server A uses spfile,

Create pfile: create pfile from spfile based on this spfile;

3. Shut down the database on server,

Shutdown immediate. If the database cannot be shut down, you can use online backup. In this case, the database must be in archivelog mode. The transfer principle is the same as that allowed to be closed. We will not discuss it here.

4. Back up all data files on server A, including the following:
A) do not copy all temporary datafile files, such as temp01.dbf)
B) all online redo logs
C) All archive redo logs
D) All control files
E) $ Linux Oracle_HOME/dbs/init <SID>;. ora this file was created in step 2 above)
F) $ Linux Oracle_HOME/dbs/orapw <SID>; this is password file)
G) $ Linux Oracle_HOME/network/listener. ora can be omitted in this step, and can be regenerated later)
H) $ Linux Oracle_BASE/admin/<SID>;/All the directories in the directory, such as udump, cdump, and bdump, can be omitted. You can also create directories manually in the future)

5. Upload all the backup files to the corresponding directory of server B through FTP or other tools. For example, the original $ Linux Oracle_BASE/oradata/<SID>;/system01.dbf on server A is now uploaded to server B $ Linux Oracle_BASE/oradata/<SID>;/system01.dbf.

Make sure that the logical structure of the directory is the same. In fact, the physical structure has changed. On A, $ Linux Oracle_BASE is/Linux Oracle, and on B is/u01/Linux Oracle ). Other files are processed in the same way. If there is no corresponding directory on server B, create it manually.

6. Edit the init <SID> uploaded to server B;

.In the ora file, change all the directory structures involved to the current directory structure in B. For example, in this example, change/Linux Oracle to/u01/Linux Oracle.

7. On server B, sqlplus "/as sysdba" prompts to enter the idle process.

8. create spfile and create spfile from pfile based on the modified pfile;

9. Start the database to the mount state and start up the mount;

10. Modify the location of all data files in the control file,

You can use spool to generate all SQL statements: SQL>; alter database rename file '/Linux Oracle/oradata/oralinux/system01.dbf'
2 to '/u01/Linux Oracle/oradata/oralinux/system01.dbf'; modify all data file locations according to the preceding syntax.

11. Now the database can be used,

Alter database open;

12. Add temporary files to the TEMP tablespace:

Alter tablespace TEMP add tempfile ''/u01/Linux Oracle/oradata/oralinux/temp01.dbf' size 20 M;

13. There will be some follow-up work,

This includes updating the Listener Configuration File on Database B, because 9i instances can be automatically registered to the listener, then it will be registered immediately. If you start the database and then start listening, it will be slightly delayed before registration), modify the/etc/oratab file to use the dbstart and dbshut scripts.

In this way, even if the database is completely transferred, you can send me an email if you have any questions. No problem. As long as all online backups are available, but the backups are online, it is unavoidable to lack some data if your business is busy. For online backup, you must first recover the database. As follows:

 
 
  1. [zhangleyi@as orcl]$ sqlplus "/ as sysdba"  
  2. SQL*Plus: Release 9.2.0.4.0 - Production on Mon Jan 5 17:33:38 2004  
  3. Copyright (c) 1982, 2002, Linux Oracle Corporation. All rights reserved.  
  4. Connected to an idle instance.  
  5. SQL>; startup   
  6. Linux Oracle instance started.  
  7. Total System Global Area 118035836 bytes   
  8. Fixed Size                   451964 bytes   
  9. Variable Size              96468992 bytes   
  10. Database Buffers           20971520 bytes   
  11. Redo Buffers                 143360 bytes   
  12. Database mounted.   
  13. ORA-01113: file 1 needs media recovery   
  14. ORA-01110: data file 1: '/Linux Oracle/oradata/orcl/system01.dbf' 
 
 
  1. SQL>; recover database   
  2. Media recovery complete.  
  3. SQL>; shutdown   
  4. ORA-01109: database not open  
  5. Database dismounted.   
  6. Linux Oracle instance shut down.   
  7. SQL>; startup   
  8. Linux Oracle instance started.  
  9. Total System Global Area 118035836 bytes   
  10. Fixed Size                   451964 bytes   
  11. Variable Size              96468992 bytes   
  12. Database Buffers           20971520 bytes   
  13. Redo Buffers                 143360 bytes   
  14. Database mounted.   
  15. Database opened.   
  16. SQL>
  1. Migration of Linux Oracle Database Files
  2. Linux Oracle accesses MySQL Client software
  3. Linux Oracle 10 Gb software installation database
  4. Linux Oracle can be installed on WMware virtual machines
  5. Linux management tool installation package and add source

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.