Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use rman transfer tablespace

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to use rman transmission table space". In daily operation, I believe many people have doubts about how to use rman transmission table space. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use rman transmission table space". Next, please follow the editor to study!

Using the imp/impdp transport tablespace transport_tablespace satisfies the following conditions

1. Same character set

two。 The tablespace to be exported must be read only and self-contained, meaning that objects in that tablespace cannot depend on other tablespaces.

3. First export the source data, and copy the data files of the tablespace to the corresponding directory of another database.

RMAN does not need a tablespace READ ONLY because it is a backup set for transfer, but it also requires the same character set and self-contained.

The following test is based on the RMAN transport tablespace.

Test environment

Source database:

OS=RHEL 6.4

DB=ORACLE11GR2

IP=192.168.1.171

SID=hjj

ASM storage.

Target database:

OS=WIN7 64BIT

DB=ORACLE11GR2

IP=192.168.1.1

SID=orcl

FS storage.

I. on the source database side

1. Create a test tablespace

SQL > create tablespace tt1 datafile'+ DATA_DG/hjj/datafile/test01.dbf' size 100m

Tablespace created.

two。 Create users and authorize

SQL > create user tt1 identified by oracle default tablespace tt1

User created.

SQL > grant connect,resource to tt1

Grant succeeded.

3. Create a test table

SQL > create table tt1.t as select * from dba_objects

Table created.

4. View data

SQL > conn tt1/oracle

Connected.

SQL > select count (*) from t

COUNT (*)

-

21293

4. Confirm whether the platform that transports the tablespace is compatible

On the source database side:

SQL > select tp.* from v$transportable_platform tp,v$database d where tp.PLATFORM_NAME = d.PLATFORM_NAME

PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT

-

10 Linux IA (32-bit) Little

On the target database side:

SQL > select tp.* from v$transportable_platform tp,v$database d where tp.PLATFORM_NAME = d.PLATFORM_NAME

PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT

-

12 Microsoft Windows x86 64-bit Little

You can see that both the windows platform and linux are Little and are compatible.

5. Confirm whether the tablespace of the source database is self-contained

SQL > exec dbms_tts.transport_set_check ('tt1',true,true)

PL/SQL procedure successfully completed.

SQL > select * from transport_set_violations

No rows selected

6. Back up the source database

[oracle@myrac1 ~] $rman target sys/oracle@hjj catalog rman/rman

Recovery Manager: Release 11.2.0.1.0-Production on Wed Mar 5 19:54:06 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to target database: HJJ (DBID=2845675742)

Connected to recovery catalog database

RMAN > sql "alter system checkpoint"

Starting full resync of recovery catalog

Full resync complete

Sql statement: alter system checkpoint

RMAN > sql "alter system archive log current"

Sql statement: alter system archive log current

RMAN > sql "alter system switch logfile"

Sql statement: alter system switch logfile

RMAN > backup database

Starting backup at 05-MAR-14

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting full datafile backup set

Channel ORA_DISK_1: specifying datafile (s) in backup set

Input datafile file number=00001 name=+DATA_DG/hjj/datafile/system.260.837919351

Input datafile file number=00002 name=+DATA_DG/hjj/datafile/sysaux.261.837919391

Input datafile file number=00005 name=+DATA_DG/hjj/datafile/tbs01.dbf

Input datafile file number=00003 name=+DATA_DG/hjj/datafile/undotbs1.262.837919417

Input datafile file number=00007 name=+DATA_DG/hjj/datafile/tt01.dbf

Input datafile file number=00006 name=+DATA_DG/hjj/datafile/rman_tbs0.dbf

Input datafile file number=00004 name=+DATA_DG/hjj/datafile/users.264.837919457

Channel ORA_DISK_1: starting piece 1 at 05-MAR-14

Channel ORA_DISK_1: finished piece 1 at 05-MAR-14

Piece handle=+DG_FRA/hjj/backupset/2014_03_05/nnndf0_tag20140305t215129_0.265.841441893 tag=TAG20140305T215129 comment=NONE

Channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15

Finished backup at 05-MAR-14

Starting Control File and SPFILE Autobackup at 05-MAR-14

Piece handle=+DG_FRA/hjj/autobackup/2014_03_05/s_841441968.267.841441969 comment=NONE

Finished Control File and SPFILE Autobackup at 05-MAR-14

RMAN > backup archivelog all

Starting backup at 05-MAR-14

Current log archived

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting archived log backup set

Channel ORA_DISK_1: specifying archived log (s) in backup set

Input archived log thread=1 sequence=88 RECID=47 STAMP=841355567

Input archived log thread=1 sequence=89 RECID=48 STAMP=841366180

Input archived log thread=1 sequence=90 RECID=49 STAMP=841433642

Input archived log thread=1 sequence=91 RECID=50 STAMP=841434920

Input archived log thread=1 sequence=92 RECID=51 STAMP=841434930

Input archived log thread=1 sequence=93 RECID=52 STAMP=841435200

Input archived log thread=1 sequence=94 RECID=53 STAMP=841439190

Input archived log thread=1 sequence=95 RECID=54 STAMP=841439198

Input archived log thread=1 sequence=96 RECID=55 STAMP=841439439

Input archived log thread=1 sequence=97 RECID=56 STAMP=841439759

Input archived log thread=1 sequence=98 RECID=57 STAMP=841440347

Input archived log thread=1 sequence=99 RECID=58 STAMP=841441558

Input archived log thread=1 sequence=100 RECID=59 STAMP=841441564

Input archived log thread=1 sequence=101 RECID=60 STAMP=841442014

Channel ORA_DISK_1: starting piece 1 at 05-MAR-14

Channel ORA_DISK_1: finished piece 1 at 05-MAR-14

Piece handle=+DG_FRA/hjj/backupset/2014_03_05/annnf0_tag20140305t215336_0.264.841442017 tag=TAG20140305T215336 comment=NONE

Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08

Finished backup at 05-MAR-14

Starting Control File and SPFILE Autobackup at 05-MAR-14

Piece handle=+DG_FRA/hjj/autobackup/2014_03_05/s_841442025.263.841442027 comment=NONE

Finished Control File and SPFILE Autobackup at 05-MAR-14

RMAN > backup current controlfile

Starting backup at 05-MAR-14

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting full datafile backup set

Channel ORA_DISK_1: specifying datafile (s) in backup set

Including current control file in backup set

Channel ORA_DISK_1: starting piece 1 at 05-MAR-14

Channel ORA_DISK_1: finished piece 1 at 05-MAR-14

Piece handle=+DG_FRA/hjj/backupset/2014_03_05/ncnnf0_tag20140305t215401_0.262.841442045 tag=TAG20140305T215401 comment=NONE

Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02

Finished backup at 05-MAR-14

Starting Control File and SPFILE Autobackup at 05-MAR-14

Piece handle=+DG_FRA/hjj/autobackup/2014_03_05/s_841442048.261.841442051 comment=NONE

Finished Control File and SPFILE Autobackup at 05-MAR-14

Note: full library backup is used here, because in addition to the target tablespace backup, RMAN also needs SYSTEM, SYSAUX and UNDO tablespace backups. If any tablespace backup does not exist, it will lead to the error of "RMAN-06019: unable to convert tablespace name"TTB1".

7. Generate transfer set (on source database)

RMAN > transport tablespace tt1 tablespace destination'/ s01swap dd' auxiliary destination'/ s01Univer dd'

Creating automatic instance, with SID='CDty'

Initialization parameters used for automatic instance:

Db_name=HJJ

Db_unique_name=CDty_tspitr_HJJ

Compatible=11.2.0.0.0

Db_block_size=8192

Db_files=200

Sga_target=280M

Processes=50

Db_create_file_dest=/s01/dd

Log_archive_dest_1='location=/s01/dd'

# No auxiliary parameter file used

Starting up automatic instance HJJ

Oracle instance started

Total System Global Area 292933632 bytes

Fixed Size 1336092 bytes

Variable Size 100666596 bytes

Database Buffers 184549376 bytes

Redo Buffers 6381568 bytes

Automatic instance created

Running TRANSPORT_SET_CHECK on recovery set tablespaces

TRANSPORT_SET_CHECK completed successfully

Contents of Memory Script:

{

# set requested point in time

Set until scn 2004003

# restore the controlfile

Restore clone controlfile

# mount the controlfile

Sql clone 'alter database mount clone database'

# archive current online log

Sql 'alter system archive log current'

# resync catalog

Resync catalog

}

Executing Memory Script

Executing command: SET until clause

Starting restore at 05-MAR-14

Allocated channel: ORA_AUX_DISK_1

Channel ORA_AUX_DISK_1: SID=59 device type=DISK

Channel ORA_AUX_DISK_1: starting datafile backup set restore

Channel ORA_AUX_DISK_1: restoring control file

Channel ORA_AUX_DISK_1: reading from backup piece + DG_FRA/hjj/autobackup/2014_03_05/s_841441968.267.841441969

Channel ORA_AUX_DISK_1: piece handle=+DG_FRA/hjj/autobackup/2014_03_05/s_841441968.267.841441969 tag=TAG20140305T215248

Channel ORA_AUX_DISK_1: restored backup piece 1

Channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08

Output file name=/s01/dd/HJJ/controlfile/o1_mf_9kj3fpmt_.ctl

Finished restore at 05-MAR-14

Sql statement: alter database mount clone database

Sql statement: alter system archive log current

Starting full resync of recovery catalog

Full resync complete

Contents of Memory Script:

{

# set requested point in time

Set until scn 2004003

# set destinations for recovery set and auxiliary set datafiles

Set newname for clone datafile 1 to new

Set newname for clone datafile 3 to new

Set newname for clone datafile 2 to new

Set newname for clone tempfile 1 to new

Set newname for datafile 7 to

"/ s01/dd/tt01.dbf"

# switch all tempfiles

Switch clone tempfile all

# restore the tablespaces in the recovery set and the auxiliary set

Restore clone datafile 1, 3, 2, 7

Switch clone datafile all

}

Executing Memory Script

Executing command: SET until clause

Executing command: SET NEWNAME

Executing command: SET NEWNAME

Executing command: SET NEWNAME

Executing command: SET NEWNAME

Executing command: SET NEWNAME

Renamed tempfile 1 to / s01/dd/HJJ/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 05-MAR-14

Using channel ORA_AUX_DISK_1

Channel ORA_AUX_DISK_1: starting datafile backup set restore

Channel ORA_AUX_DISK_1: specifying datafile (s) to restore from backup set

Channel ORA_AUX_DISK_1: restoring datafile 00001 to / s01/dd/HJJ/datafile/o1_mf_system_%u_.dbf

Channel ORA_AUX_DISK_1: restoring datafile 00003 to / s01/dd/HJJ/datafile/o1_mf_undotbs1_%u_.dbf

Channel ORA_AUX_DISK_1: restoring datafile 00002 to / s01/dd/HJJ/datafile/o1_mf_sysaux_%u_.dbf

Channel ORA_AUX_DISK_1: restoring datafile 00007 to / s01/dd/tt01.dbf

Channel ORA_AUX_DISK_1: reading from backup piece + DG_FRA/hjj/backupset/2014_03_05/nnndf0_tag20140305t215129_0.265.841441893

Channel ORA_AUX_DISK_1: piece handle=+DG_FRA/hjj/backupset/2014_03_05/nnndf0_tag20140305t215129_0.265.841441893 tag=TAG20140305T215129

Channel ORA_AUX_DISK_1: restored backup piece 1

Channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:56

Finished restore at 05-MAR-14

Datafile 1 switched to datafile copy

Input datafile copy RECID=5 STAMP=841442234 file name=/s01/dd/HJJ/datafile/o1_mf_system_9kj3g6mv_.dbf

Datafile 3 switched to datafile copy

Input datafile copy RECID=6 STAMP=841442234 file name=/s01/dd/HJJ/datafile/o1_mf_undotbs1_9kj3g77n_.dbf

Datafile 2 switched to datafile copy

Input datafile copy RECID=7 STAMP=841442234 file name=/s01/dd/HJJ/datafile/o1_mf_sysaux_9kj3g706_.dbf

Datafile 7 switched to datafile copy

Input datafile copy RECID=8 STAMP=841442234 file name=/s01/dd/tt01.dbf

Contents of Memory Script:

{

# set requested point in time

Set until scn 2004003

# online the datafiles restored or switched

Sql clone "alter database datafile 1 online"

Sql clone "alter database datafile 3 online"

Sql clone "alter database datafile 2 online"

Sql clone "alter database datafile 7 online"

# recover and open resetlogs

Recover clone database tablespace "TT1", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog

Alter clone database open resetlogs

}

Executing Memory Script

Executing command: SET until clause

Sql statement: alter database datafile 1 online

Sql statement: alter database datafile 3 online

Sql statement: alter database datafile 2 online

Sql statement: alter database datafile 7 online

Starting recover at 05-MAR-14

Using channel ORA_AUX_DISK_1

Starting media recovery

Archived log for thread 1 with sequence 101 is already on disk as file / s01/app/oracle/archivelog/1_101_837919326.dbf

Archived log file name=/s01/app/oracle/archivelog/1_101_837919326.dbf thread=1 sequence=101

Media recovery complete, elapsed time: 00:00:00

Finished recover at 05-MAR-14

Database opened

Contents of Memory Script:

{

# make read only the tablespace that will be exported

Sql clone 'alter tablespace TT1 read only'

# create directory for datapump export

Sql clone "create or replace directory STREAMS_DIROBJ_DPDIR as''

/ s01DUDUDUDRON'"

}

Executing Memory Script

Sql statement: alter tablespace TT1 read only

Sql statement: create or replace directory STREAMS_DIROBJ_DPDIR as'/ s01According to ddwatches'

Performing export of metadata...

EXPDP > Starting "SYS". "TSPITR_EXP_CDty":

EXPDP > Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

EXPDP > Processing object type TRANSPORTABLE_EXPORT/TABLE

EXPDP > Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

EXPDP > Master table "SYS". "TSPITR_EXP_CDty" successfully loaded/unloaded

EXPDP > *

EXPDP > Dump file set for SYS.TSPITR_EXP_CDty is:

EXPDP > / s01/dd/dmpfile.dmp

EXPDP > *

EXPDP > Datafiles required for transportable tablespace TT1:

EXPDP > / s01/dd/tt01.dbf

EXPDP > Job "SYS". "TSPITR_EXP_CDty" successfully completed at 22:00:01

Export completed

-- Start of sample PL/SQL script for importing the tablespaces

-- creating directory objects

CREATE DIRECTORY STREAMS$DIROBJ$1 AS'/ s01DDMPUDUP'

CREATE DIRECTORY STREAMS$DIROBJ$DPDIR AS'/ s01swap dd'

DECLARE

-- the datafiles

Tbs_files dbms_streams_tablespace_adm.file_set

Cvt_files dbms_streams_tablespace_adm.file_set

-- the dumpfile to import

Dump_file dbms_streams_tablespace_adm.file

Dp_job_name VARCHAR2 (30): = NULL

-- names of tablespaces that were imported

Ts_names dbms_streams_tablespace_adm.tablespace_set

BEGIN

-- dump file name and location

Dump_file.file_name: = 'dmpfile.dmp'

Dump_file.directory_object: = 'STREAMS$DIROBJ$DPDIR'

-- forming list of datafiles for import

Tbs_files (1) .file_name: = 'tt01.dbf'

Tbs_files (1) .directory_object: = 'STREAMS$DIROBJ$1'

-- import tablespaces

Dbms_streams_tablespace_adm.attach_tablespaces (

Datapump_job_name = > dp_job_name

Dump_file = > dump_file

Tablespace_files = > tbs_files

Converted_files = > cvt_files

Tablespace_names = > ts_names)

-- output names of imported tablespaces

IF ts_names IS NOT NULL AND ts_names.first IS NOT NULL THEN

FOR i IN ts_names.first.. Ts_names.last LOOP

Dbms_output.put_line ('imported tablespace' | | ts_names (I))

END LOOP

END IF

END

/

-- dropping directory objects

DROP DIRECTORY STREAMS$DIROBJ$1

DROP DIRECTORY STREAMS$DIROBJ$DPDIR

-- End of sample PL/SQL script

Removing automatic instance

Shutting down automatic instance

Database closed

Database dismounted

Oracle instance shut down

Automatic instance removed

Auxiliary instance file/ s01/dd/HJJ/datafile/o1_mf_temp_9kj3l8ph_.tmp deleted

Auxiliary instance file / s01/dd/HJJ/onlinelog/o1_mf_3_9kj3l3lr_.log deleted

Auxiliary instance file / s01/dd/HJJ/onlinelog/o1_mf_2_9kj3l20t_.log deleted

Auxiliary instance file / s01/dd/HJJ/onlinelog/o1_mf_1_9kj3l0b0_.log deleted

Auxiliary instance file/ s01/dd/HJJ/datafile/o1_mf_sysaux_9kj3g706_.dbf deleted

Auxiliary instance file/ s01/dd/HJJ/datafile/o1_mf_undotbs1_9kj3g77n_.dbf deleted

Auxiliary instance file/ s01/dd/HJJ/datafile/o1_mf_system_9kj3g6mv_.dbf deleted

Auxiliary instance file/ s01/dd/HJJ/controlfile/o1_mf_9kj3fpmt_.ctl deleted

The files in the temporary directory / s01/dd are automatically deleted after the transfer is completed.

Check the directory / s01/dd

[root@myrac1 dd] # ll

Total 102508

-rw-r- 1 oracle asmadmin 90112 Mar 5 22:00 dmpfile.dmp

Drwxr-x--- 5 oracle asmadmin 4096 Mar 5 21:25 HJJ

-rw-r--r-- 1 oracle oinstall 2022 Mar 5 22:00 impscrpt.sql

-rw-r- 1 oracle asmadmin 104865792 Mar 5 21:57 tt01.dbf

Impscrpt.sql-metadata information, the target database must have a corresponding object owner, and the data file path is inconsistent and the script must be modified.

Dmpfile.dmp-- which is also metadata information, there is no restriction above if you import metadata information using dump files.

Tt01.dbf-data file, you can find that the generated data file is exactly the same as the original data file.

HJJ is a temporary directory under / s01/dd.

8. Import metadata sets into the target database

a. Using asm storage system, using dump to import

Convert datafile'/ opt/tts/td/tts.288.755520393' format'+ datagroup'

If you are using asm, you need to put the files on os into asm, and the above command can convert data files between os and asm.

Impdp system/oracle@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='+DATAGROUP/ORCL/DATAFILE/TTS.290.755528197'

b. Use the file system and import using dump.

Impdp system/oracle@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='/opt/oradata/tts.288.755520393'

C.@/opt/tts/td/impsctpt.sql

9. Copy the source database / s01/dd directory and data files to the target database D:\ dd

D:\ dd > ls

Dmpfile.alg dmpfile.dmp impscrpt.sql tt01.dbf

10. Check whether the block sizes of the source and target databases are the same

Source database:

SQL > select block_size from dba_tablespaces where tablespace_name = 'TT1'

BLOCK_SIZE

-

8192

Target database:

SQL > show parameter db_block_size

NAME TYPE VALUE

-

Db_block_size integer 8192

11. Create a user on the target data

C:\ > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 6 14:25:09 2014

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > create user tt1 identified by oracle

User created.

SQL > grant connect,resource to tt1

Grant succeeded.

Run the impscrpt.sql script

SQL > @ D:\ dd\ impscrpt.sql

Directory created.

Directory created.

DECLARE

*

ERROR at line 1:

ORA-06512: at "SYS.DBMS_STREAMS_TABLESPACE_ADM", line 1854

ORA-06512: at line 18

Directory dropped.

Directory dropped.

Look at the dmpfile.alg file and find

Master table "SYS". "SYS_IMPORT_TRANSPORTABLE_04" successfully loaded/unloaded

Starting "SYS". "SYS_IMPORT_TRANSPORTABLE_04":

Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

ORA-39123: Data Pump transportable tablespace job aborted

ORA-29345: cannot plug a tablespace into a database using an incompatible character set

Job "SYS". "SYS_IMPORT_TRANSPORTABLE_04" stopped due to fatal error at 14:58:40

Prompt that tablespaces cannot be imported into databases with incompatible character sets

View the character sets of the source and target databases

Source database:

SQL > select userenv ('language') from dual

USERENV ('LANGUAGE')

AMERICAN_AMERICA.WE8MSWIN1252

Target database:

SQL > select userenv ('language') from dual

USERENV ('LANGUAGE')

-

AMERICAN_AMERICA.AL32UTF8

It is true that the character set is inconsistent, but I can use impdp to manually import settings and set NLS_LANG under win

Try to do what you want.

SQL > create directory dp as'd:\ dd'

Directory created.

D:\ dd > impdp system/oracle@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='tt01.dbf'

Import: Release 11.2.0.1.0-Production on Thu Mar 6 14:51:07 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Master table "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded

Starting "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01": system/*@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='tt01.dbf'

Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

ORA-39123: Data Pump transportable tablespace job aborted

ORA-29345: cannot plug a tablespace into a database using an incompatible character set

Job "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at 14:51:15

The same error was found and the character set is not compatible. Modify the character set of the target database to the character set of the source database

SQL > conn / as sysdba

Connected to an idle instance.

SQL > alter database character set INTERNAL_USE WE8MSWIN1252

Alter database character set INTERNAL_USE WE8MSWIN1252

*

ERROR at line 1:

ORA-01034: ORACLE not available

Process ID: 0

Session ID: 0 Serial number: 0

SQL > startup mount

ORACLE instance started.

Total System Global Area 1235959808 bytes

Fixed Size 2175288 bytes

Variable Size 956305096 bytes

Database Buffers 268435456 bytes

Redo Buffers 9043968 bytes

Database mounted.

SQL > alter database character set INTERNAL_USE WE8MSWIN1252

Alter database character set INTERNAL_USE WE8MSWIN1252

*

ERROR at line 1:

ORA-12719: operation requires database is in RESTRICTED mode

SQL > alter system enable restricted session

System altered.

SQL > alter database character set internal_use WE8MSWIN1252

Alter database character set internal_use WE8MSWIN1252

*

ERROR at line 1:

ORA-00604: error occurred at recursive SQL level 1

ORA-01109: database not open

SQL > alter database open

Database altered.

SQL > alter database character set internal_use WE8MSWIN1252

Database altered.

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL > startup mount

ORACLE instance started.

Total System Global Area 1235959808 bytes

Fixed Size 2175288 bytes

Variable Size 956305096 bytes

Database Buffers 268435456 bytes

Redo Buffers 9043968 bytes

Database mounted.

SQL > alter system disable restricted session

System altered.

SQL > alter database open

Database altered.

SQL > select userenv ('language') from dual

USERENV ('LANGUAGE')

AMERICAN_AMERICA.WE8MSWIN1252

Import using impdp again

D:\ dd > impdp system/oracle@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='d:\ dd\ tt01.dbf'

Import: Release 11.2.0.1.0-Production on Thu Mar 6 15:59:43 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Master table "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded

Starting "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01": system/*@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='d:\ dd\ tt01.dbf'

Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

Processing object type TRANSPORTABLE_EXPORT/TABLE

Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

Job "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 15:59:57

Impdp execution, you can run impscrpt.sql, which is also successful. Because the errors reported in both ways are the same.

D:\ dd > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 6 16:02:02 2014

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > alter user tt1 defalut tablespace tt1

Alter user tt1 defalut tablespace tt1

*

ERROR at line 1:

ORA-00922: missing or invalid option

SQL > alter user tt1 default tablespace tt1

User altered.

The table space imported by the target side defaults to READ-ONLY;. Change the table space to READ WRITE.

SQL > select tablespace_name,status from dba_tablespaces where tablespace_name = 'TT1'

TABLESPACE_NAME STATUS

TT1 READ ONLY

SQL > alter tablespace tt1 read write

Tablespace altered.

SQL > select tablespace_name,status from dba_tablespaces where tablespace_name = 'TT1'

TABLESPACE_NAME STATUS

TT1 ONLINE

SQL > conn tt1/oracle

Connected.

SQL > select count (*) from t

COUNT (*)

-

21293

At this point, the tablespace is migrated from the linux ASM disk group to the win FS system.

Problems encountered and points for attention

1. The name of the source database tablespace cannot be test because test is the keyword of RMAN.

RMAN > transport tablespace test tablespace destination "/ s01/dd" auxiliary destination "/ s01/dd"

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-00558: error encountered while parsing input commands

RMAN-01009: syntax error: found "test": expecting one of: "double-quoted-string, identifier, single-quoted-string"

RMAN-01007: at line 1 column 22 file: standard input

Http://docs.oracle.com/cd/B19306_01/backup.102/b14194/rcmcomma001.htm#RCMRF909 has instructions.

two。 If the byte order of the two platforms is not the same, you can use rman for conversion.

RMAN > convert tablespace tt1 to platform 'Microsoft Windows IA (32-bit)' format'/ tmp/%N_%F'

RMAN > convert datafile'/ tmp/BOOKS_5' db_file_name_convert'/ tmp/BOOKS_5','/tmp/books01.dbf'

3. The error in the process of creating a transfer set is as follows

ORA-19502: write error on file "/ s01/dd/HJJ/datafile/o1_mf_system_9kj14qc1_.dbf", block number 82816 (block size=8192)

ORA-27072: File I/O error

Linux Error: 25: Inappropriate ioctl for device

Additional information: 4

Additional information: 82816

Additional information: 344064

Auxiliary instance file/ s01/dd/HJJ/controlfile/o1_mf_9kj148lp_.ctl deleted

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of transport tablespace command at 03/05/2014 21:18:59

RMAN-03015: error occurred in stored script Memory Script

RMAN-06136: ORACLE error from auxiliary database: ORA-01180: can not create datafile 1

ORA-01110: datafile 1:'+ DATA_DG/hjj/datafile/system.260.837919351'

Because when you create a transfer set, you need a temporary directory / s01/dd, where the datafile,onlinelog,controlfile in the backup set is stored, so estimate the space in advance.

This mistake is caused by the lack of space.

At this point, the study on "how to use the rman transport table space" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report