(Direct file copy)
I recently learned how to start Oracle databases, so I created a database for testing in Windows.
After porting to Linux, we successfully transplanted Linux to Windows a few days ago. However, many problems may occur when porting Windows to Linux,
Windows users are not case sensitive, but Linux users are case sensitive. Please pay attention to this. Let's proceed with this process!
As mentioned above, I directly use file replication to port the database used in Windows to Linux,
Instead of using other tools.
Although this porting is not very useful in actual production, for a new oracle, it can indeed learn a lot from it, so write
This article is for your reference.
System Environment: Linux is a 32-bit platform. The Linux memory, CPU, and other hardware conditions are the same as those in Windows.
If the hardware conditions are different, the following data migration may encounter other problems.
Software environment: the oracle software installed on Linux and Windows platforms is
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Prod
All are installed on the Enterprise Edition.
If the versions on both sides are different, no experiments have been conducted.
I will give a rough look at the process, and redo the data files, control files, and log group files in Windows,
Copy the parameter file to Linux, and change the control file in the parameter file to the Linux directory.
And re-generate the control file. The detailed steps are as follows:
The database configuration in Linux is as follows:
Databases are managed by file systems.
Instance name: orcl
Database Name: orcl
ORACLE_BASE =/u01/app/oracle/
ORACLE_HOME =/u01/app/oracle/product/10.2.0/db_1
Database file storage location:/u02/oradata/orcl
The Database Configuration on Windows is as follows:
Databases are managed by file systems.
Instance name: orcl
Database Name: orcl because the database is directly copied from a Windows file, the database name cannot be changed.
ORACLE_BASE = D: \ oracle
ORACLE_HOME = D: \ oracle \ product \ 10.2.0 \ db_1
ORACLE_SID = orcl
Database file storage location: D: \ oracle \ oradata \ orcl
The procedure is as follows:
-- Log on to the database under Windows
C: \> sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Tuesday July 1 14:53:23 2008
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connect:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
-- Create a parameter pfile File
SQL> create pfile = 'initorcl. ora 'from spfile;
The file has been created.
-- Close database
SQL> shutdown immediate;
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.
For Linux, enter the following content to create a folder:
Mkdir-o/u02/oradata/orcl
Copy parameter files, control files, data files, and redo log group files to the Linux directory,
I started a samba service in Linux and shared the/u02/oradata/orcl folder.
You can also open an FTP in Linux and upload the file to the Linux machine through FTP.
On Windows, redo the log group file and control file in D: \ oracle \ oradata \ orcl.
Data Files/u02/oradata/orcl in Linux
Instance parameter file in Linux: D: \ oracle \ product \ 10.2.0 \ db_1 \ database \ initorcl. ora in Windows
Copy to the directory on the Linux platform
/U01/app/oracle/product/10.2.0/db_1/dbs/initorcl. ora
Note that the file names here are case sensitive in Linux, so replace all the file names in lower case.
Run the following command on Linux to create a folder:
Mkdir-p/u01/app/oracle/admin/orcl/adump
Mkdir-p/u01/app/oracle/admin/orcl/bdump
Mkdir-p/u01/app/oracle/admin/orcl/cdump
Mkdir-p/u01/app/oracle/admin/orcl/dpdump
Mkdir-p/u01/app/oracle/admin/orcl/pfile
Mkdir-p/u01/app/oracle/admin/orcl/udump
If/u01/app/oracle/flash_recovery_area does not exist, create
Mkdir-p/u01/app/oracle/flash_recovery_area
Design Environment Variables
Set ORACLE_SID = Linux
Or change the. bash_profile file under the oracle user.
ORACLE_SID = orcl; export ORACLE_SID
Change ORACLE_SID to orcl
Open the file/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl. ora with vi
Change the directory structure in Windows to the directory structure in Linux.
Note that the file names and folders in Linux are case-sensitive. Make sure that the actual file names in the following parameters are case-insensitive. Otherwise, the database cannot be started.
The following file is my parameter file information. For reference:
Orcl. _ db_cache_size = 75497472
Orcl. _ Java _pool_size = 4194304
Orcl. _ large_pool_size = 4194304
Orcl. _ shared_pool_size = 75497472
Orcl. _ streams_pool_size = 4194304
*. Audit_file_dest = '/u01/app/oracle/admin/orcl/adump'
*. Audit_trail = 'db'
*. Background_dump_dest = '/u01/app/oracle/admin/orcl/bdump'
*. Compatible = '10. 2.0.1.0'
*. Control_files = '/u02/oradata/orcl/CONTROL01.CTL', '/u02/oradata/orcl/CONTROL02.CTL', '/u02/oradata/orcl/CONTROL03.CTL'
*. Core_dump_dest = '/u01/app/oracle/admin/orcl/cdump'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_file_multiblock_read_count = 16
*. Db_name = 'orcl'
*. Db_recovery_file_dest = '/u01/app/oracle/flash_recovery_area'
*. Db_recovery_file_dest_size = 2147483648
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = orclXDB )'
*. Job_queue_processes = 10
*. Open_cursors = 300
*. Pga_aggregate_target = 16777216
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 167772160
*. Undo_management = 'auto'
*. Undo_tablespace = 'undotbs1'
*. User_dump_dest = '/u01/app/oracle/admin/orcl/udump'
Create Password File
Orapwd file =/u01/app/oracle/product/10.2.0/db_1/dbs/orapworcl password = <password>
Log on to the database in Linux
[Oracle @ localhost ~] $ Sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Mon Jul 7 13:24:38 2008
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
-- Start to mount
SQL> startup mount pfile =/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl. ora;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 88082676 bytes
Database Buffers 75497472 bytes
Redo Buffers 2973696 bytes
Database mounted.
-- Create a spfile file, which will be started next time
SQL> create spfile = 'spfileorcl. ora 'from pfile;
File created