|
Overall Physical Migration of Linux and Platform Database
Demand: A machine is no longer used to the A machine's Oracle migration to B machines.
This paper aims to use more automation of the integration of the script to achieve the same platform for the overall migration of the database.
1.A machine operation
2.B machine operation
A machine operation
0. System version:
[Root @ DB-A tmp] # uname -a
Linux DB-A 2.6.32-358.el6.x86_64 # 1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU / Linux
[Root @ DB-A tmp] # cat / etc / issue
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Kernel \ r on an \ m
1.A current database information
Select status from v $ instance union all
Select open_mode from v $ database union all
Select * from v $ version where rownum = 1;
2. Confirm the parameter file to control the location of the file
Show parameter pfile
Show parameter control_files
Here the need to create the current spfile pfile file, to be used later.
Create pfile from spfile;
3. The location of the data files, temporary files, and redo log files
Set linesize 140 pagesize 100
Select name from v $ datafile union all
Select name from v $ tempfile union all
Select member from v $ logfile;
4. Clean off the database:
Shutdown immediate;
5. ORACLE software to determine the directory and packaged to B machine
Echo $ ORACLE_BASE
/ Ora / app / oracle
Tar -zcvf /tmp/oracle.tar.gz / ora / app / oracle
The packaged Oracle software directory and all parameter files, control files, data files, temporary files, and redo log files are copied to the B machine.
B Machine operation
0. System version:
[Root @ DB-B irnop] # uname -a
Linux DB-B 2.6.32-431.el6.x86_64 # 1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU / Linux
[Root @ DB-B irnop] # cat / etc / issue
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Kernel \ r on an \ m
1. Install dependencies and adjust system parameters
slightly.
2. Unzip the ORACLE_HOME to the software installation directory on the B machine: / u01 / app / oracle
Tar zxvf oracle.tar.gz
After decompression oracle catalog direct mv to / u01 / app under
3. Modify the parameter file pfile and start the database to nomount
According to the actual situation of B machines to amend the value of memory occupied by the database, and confirm that the path written in the parameter file is there.
Startup nomount pfile = '$ ORACLE_HOME / dbs / initirnop.ora'
SQL> startup nomount pfile = '$ ORACLE_HOME / dbs / initirnop.ora'
ORACLE instance started.
Total System Global Area 2.3717E + 10 bytes
Fixed Size 2239176 bytes
Variable Size1.3153E + 10 bytes
Database Buffers 1.0536E + 10 bytes
Redo Buffers 25612288 bytes
4. Boot to mount
SQL> alter database mount;
Database altered.
5. Data files, temporary files, rename redirection log files
Set linesize 140 pagesize 100
Select 'alter database rename file' '' || name || 'to' '/ xxx' || name || '' ';' from v $ datafile union all
Select 'alter database rename file' '' || name || 'to' '/ xxx' || name || '' ';' from v $ tempfile union all
Select 'alter database rename file' '' || member || 'to' '/ xxx' || member || '' ';' from v $ logfile;
According to the actual situation will be replaced old_name new_name
Old_name: / xxx / oradata
New_name: / new / oradata
And then execute the redirect SQL, check whether the current path is correct:
Select name from v $ datafile union all
Select name from v $ tempfile union all
Select member from v $ logfile;
Modify the system directory permissions:
Chown -R oracle: oinstall / new / oradata
6. Open the database:
SQL> alter database open; |
|
|
|