Migrate the entire database and database

Source: Internet
Author: User

Migrate the entire database and database
1) migrate the entire database, and then upgrade the database.

Step 1:Stop the database normally, and restart the database in read-only mode.

Startup mount

Alter database open read only;

 

Step 2:Run the script in the RMAN state to split and export the source database data.

About the conversion problem: we have said that it is okay to convert all the small bytes in the transmitted tablespace, but now it is a database, and the small bytes also need to be converted because it is a database, if one is a high byte or a small byte, there is no way to convert it successfully. That is to say, the two bytes must be of the same type.

Run

{

Allocate channel c1 type disk;

Allocate channel c2 type disk;

 CONVERT DATABASE NEW DATABASE'Test'

 Transport script'/Home/oracle/transportdb. SQL'

To platform 'Microsoft Windows IA (64-bit )'

Db_file_name_convert '/oradata/miao ''/oracle/orabak /';

}

After the conversion, you can view the converted file in/oracle/orabak.

Step 3:Then, we will upload all the files to the E: \ ORABAK directory in windows.

 Step 4:Create parameter files and control files on the target machine

| -- The parameter file content is as follows:

*. Audit_file_dest = 'e: \ app \ Administrator \ admin \ senhao \ adump'

*. Audit_trail = 'none'

*. Compatible = '11. 2.0.0.0'

*. Control_files = 'e: \ orabak \ control01.ctl ', 'e: \ orabak \ control02.ctl'

*. Db_block_size = 8192

*. Db_domain =''

*. Db_name = 'test'

*. Deferred_segment_creation = FALSE

*. Diagnostic_dest = 'e: \ app \ Administrator'

*. Memory_target = 837812224

*. Nls_language = 'simplified CHINESE'

*. Nls_territory = 'China'

*. Open_cursors = 300

*. Processses = 150

*. Remote_login_passwordfile = 'clusive'

*. Undo_tablespace = 'undotbs1'

 

| -- Control file content:

Create controlfile reuse set database "TEST" RESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXINSTANCES 8

# MAXLOGHISTORY 292

LOGFILE

GROUP 1 'e: \ orabak \ redo01.log' size 50 M,

GROUP 2 'e: \ orabak \ redo02.log' size 50 M,

GROUP 3 'e: \ orabak \ redo03.log' size 50 M

DATAFILE

'E: \ orabak \ system01.dbf ',

'E: \ orabak \ undotbs01.dbf ',

'E: \ orabak \ sysaux01.dbf ',

'E: \ orabak \ users01.dbf ',

'E: \ orabak \ example01.dbf'

Character set ZHS16GBK

;

 

Step 5:Create an Instance name and use the ORADIM command under WIN

> Oradim-NEW-SID test

 

Step 6:Start the database to NOMOUNT and create a control file

SQL> startup nomount pfile = e: \ orabak \ inittest. ora

SQL> @ e: \ orabak \ ctl.sh.txt

 Step 7:Here, we should pay special attention: because our current database is 11 GB, but the database is 10 Gb, when we open the database, be sure to open it in the upgrade mode. Otherwise, the database will be damaged.

SQL> alter database openResetlogs upgrade;

Step 8:Now we need to upgrade the database. The scripts used are all common.

@? /Rdbms/admin/catupgrd. SQL

 

We can see a ORA-00904 error, we can view through meatlink can be because there is a table in 10 training less line, we can add it. If not, create

How can we solve this problem? Let's take a look at the rows in the table?

We can see that our table has only three rows, so we need to add one row now, or delete all three rows, and then insert four rows again. Syntax:

1) If the registry $ database table does not get created by the Pre-Upgrade Script, then it may be created using the below SQL statement:

SQL> 'create TABLE registry $ database (
Platform_id NUMBER,
Platform_name VARCHAR2 (101 ),
Edition VARCHAR2 (30 ),
Tz_version NUMBER
)';

2) Then manually insert the Platform DSTPatch information using the below SQL statement:

SQL> 'insert into registry $ database
(Platform_id, platform_name, edition, tz_version)
VALUES (select platform_id from v $ database ),
(Select platform_name from v $ database ),
NULL,
(Select version from v $ timezone_file ))';

 

Now we can add a column directly.

Alter table registry $ database add tz_version NUMBER;

 

Step 9:Here weNote that: Then we need to add a temporary tablespace to the current database. Many of them are not added in production, resulting in a problem. So let's take a look.If not, this must be added.

SQL> select file_name from dba_temp_files;

SQL> alter tablespace temp add tempfile 'e: \ orabak \ temp01.dbf' size 1000 m;

 Step 10:Now let's run the script again. Before that, we must enable SPOOL because the screen is too fast and successful. We cannot see any errors, so we need to make a log to record these things.

SQL> spool e: \ catpatch. log

SQL> @? /Rdbms/admin/catupgrd. SQL

 

 



From Weizhi note (Wiz)



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.