Handmade Database Step by STEP

xiaoxiao2021-03-06  49

Handmade Database Step by STEP

Author: kamus mail: kamus@itpub.net date: 2004-1

Sometimes we will encounter such a situation, existing databases are transferred from a machine to another machine, usually we will use export, import. However, if the data of the database is large, the data file size is large, then the process of exporting the import is likely to have problems, and the long process is also we can't tolerate. In this case, we can simply use the Copy command of the operating system to transfer the data directly. The following examples are in the Redhat Fedora Core 1 Oracle

9.2.0

.1 operations, other operating systems and Oracle versions are equally applicable. Suppose our databases on the server A, $ oracle_base is / oracle, $ oracle_home is / Oracle / Product /

9.2.0

. Now we have to transfer this database to the server B, and new $ oracle_base is / u01 / oracle, $ Oracle_home is /u01/oracle/product/9.2.0. The SID is ORINUX. The steps are as follows:

One. Install Oracle on server B, do not create a database during installation. The user's Profile can come directly from the server A, pay attention to the original $ ORACLE_HOME to the present position. two. If the Oracle on the server A uses spfile, then create a PFile: Create Pfile from spfile according to this SPFile. Turn off the database on the server A, Shutdown Immediate. If the database is not allowed to close, you can use online backups, which must be in the case of ArchiveLog mode, the principle of transfer, and the case where it is allowed, is not discussed here. four. All data files on the backup server A include the following: a) All DataFile (temporary files can not Copy, such as Temp01.dbf) b) All online redo log c) All Archive Redo Log D) All Control File E $ Oracle_Home / DBS / INIT . ORA (This file is created in the second step in the second step) f) $ Oracle_Home / DBS / ORAPW (this is Password file) $ Oracle_Home / Network / Listener . ORA (this step can be omitted, it can be regenerated) H) $ Oracle_base / admin / / under all directories, generally udump, cdump, bdump (this step can be omitted, manually created a directory) Fives. The above-described backup file is uploaded to the corresponding directory of the server B by FTP or other tools. For example, it is originally on the server A. Oracle_base / oradata / /system01.dbf, now upload to $ oracle_base / oradata / /system01.dbf on the server B, to ensure the logical structure of the directory, actually physically The structure has changed ($ oracle_base is / oracle on a), and B is / u01 / oracle). Other documents are treated, if there is no corresponding directory on the server B, then manually created. six. Edit uploaded to the INIT . OA file on the server B, the directory structure involved is all changed to the current directory structure in B. For example, this example is changed to / u01 / oracle. Seven. On Server B, SQLPLUS "/ as sysdba" prompts to enter the idle process. Eight. Create a spfile, create spfile from pfile according to the modified Pfile; Start the database to the mount status, Startup Mount; Ten. Modify all data files in Control File, you can generate all SQL: SQL> ALTER DATABAALINUX/SYSTEM01.DBF '2 to' / u01 / oracle / ORADATA / ORALINUX / System01. DBF '; modify all data file locations in accordance with the above syntax.

eleven. At this point, the database is already available, Alter Database Open; twelve. Add a temporary file to the TEMP table space: Alter TableSpace Temp Add Tempfile '' /u01/oracle/oradata/oralinux/temp01.dbf 'size20m

Thirteen. There are also some follow-up, including updating the listening profile on the database B (actually not tube, because the 9i instance can be automatically registered to the listener, if it is a listening to the database, then immediately register, if It is the first to listen to the database, then it will be slightly delayed to register), modify the / etc / oratab file to be able to use dbstart and dbshut scripts.

Such a database is completely transferred, if there is any problem, you can send me an email.

Author Blog:

http://blog.9cbs.net/kamus/

转载请注明原文地址:https://www.9cbs.com/read-117461.html

New Post(0)