之前我们确认了oracle标准版不支持tts-CSDN博客,那有没有办法绕过这个问题呢?
测试通过将$ORACLE_HOME/bin/oracle的企业版文件替换掉标准版的oracle文件之后,发现可以做tts操作。
缺点在线mv oracle会是alert日志大量告警,此时如果做expdp等操作可能失败,重启数据库后正常。如果停库操作,则cp和mv后,起库可正常。
注意此方法仅供测试使用。
xtts中最后一次的停机时间过程可以是:
- 源替换oracle后停库
- 源启动库后read only表空间
- 源最后一次增量备份导出
- 源导出传输表空间元数据
- 目标恢复增量
- 目标导入tts meta元数据
- 目标表空间可读写
- 目标停库,还原oracle,起库
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:22:11 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:23:24 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:23:24 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:23:25 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:23:25 2024
DM00 started with pid=28, OS id=12132, job SYS.SYS_IMPORT_TRANSPORTABLE_01
Tue Feb 20 12:23:25 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:23:25 2024
DW00 started with pid=29, OS id=12135, wid=1, job SYS.SYS_IMPORT_TRANSPORTABLE_01
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x14] [PC:0x7E9E7E2, lstclo()+34] [flags: 0x0, count: 1]
Errors in file /home/db1/oracle/diag/rdbms/newrsb/newrsb/trace/newrsb_dw00_12135.trc (incident=5038):
ORA-07445: exception encountered: core dump [lstclo()+34] [SIGSEGV] [ADDR:0x14] [PC:0x7E9E7E2] [Address not mapped to object] []
Incident details in: /home/db1/oracle/diag/rdbms/newrsb/newrsb/incident/incdir_5038/newrsb_dw00_12135_i5038.trc
Tue Feb 20 12:23:25 2024
Trace dumping is performing id=[cdmp_20240220122325]
Tue Feb 20 12:23:28 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:23:28 2024
Sweep [inc][5038]: completed
Sweep [inc2][5038]: completed
Tue Feb 20 12:23:28 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:25:16 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:28:36 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:28:36 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:28:36 2024
DM00 started with pid=28, OS id=12409, job SYS.SYS_IMPORT_TRANSPORTABLE_01
Tue Feb 20 12:28:36 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:28:36 2024
DW00 started with pid=29, OS id=12411, wid=1, job SYS.SYS_IMPORT_TRANSPORTABLE_01
Plug in tablespace JYC with datafile'/home/db1/oracle/oradata/newrsb/jyc01.dbf'
Tue Feb 20 12:29:16 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:30:16 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:31:37 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:31:37 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:32:01 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:32:11 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:32:12 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
[oracle@11g trace]$ tail -f alert_newrsb.logBinary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:32:11 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:32:12 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messagesTue Feb 20 12:34:35 2024
WARNING: Oracle executable binary mismatch detected.Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages
Tue Feb 20 12:34:52 2024
alter tablespace jyc read write
Completed: alter tablespace jyc read write
测试过程如下:
SQL> conn / as sysdba
Connected.
SQL> select name from v$datafile;NAME
--------------------------------------------------------------------------------
/home/db1/oracle/oradata/newrsb/system01.dbf
/home/db1/oracle/oradata/newrsb/sysaux01.dbf
/home/db1/oracle/oradata/newrsb/undotbs01.dbf
/home/db1/oracle/oradata/newrsb/users01.dbf
/home/db1/oracle/oradata/newrsb/jyc01.dbfSQL> select * from jyc.t;ID
----------1SQL> drop tablespace jyc including contents and datafiles;Tablespace dropped.SQL> select TABLESPACE_NAME,STATUS from dba_tablespaces;TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINESQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle oinstall 210704056 Dec 15 10:06 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
[oracle@11g bak]$ ll $ORACLE_HOME/bin/impdp*
-rwxr-x--x 1 oracle oinstall 179136 Feb 19 17:00 /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp
-rwxr-x--x 1 oracle oinstall 179144 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp.bak
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdpO
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 210704056 Dec 15 10:06 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwsr-s--x 1 oracle oinstall 199558504 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.bak
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracleO
[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:10:08 2024Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to an idle instance.SQL> startup
ORACLE instance started.Total System Global Area 3256942592 bytes
Fixed Size 2217752 bytes
Variable Size 1811941608 bytes
Database Buffers 1426063360 bytes
Redo Buffers 16719872 bytes
Database mounted.
Database opened.
SQL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - ProductionSQL> show parameter name;NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string newrsb
db_unique_name string newrsb
global_names boolean FALSE
instance_name string newrsb
lock_name_space string
log_file_name_convert string
service_names string newrsb
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ impdp \'/ as sysdba\' dumpfile=se-tts.dmp logfile=tts-imp1.log directory=dmp transport_datafiles='/home/db1/oracle/oradata/newrsb/jyc01.dbf'Import: Release 11.2.0.1.0 - Production on Tue Feb 20 12:10:39 2024Copyright (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 "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01": "/******** AS SYSDBA" dumpfile=se-tts.dmp logfile=tts-imp1.log directory=dmp transport_datafiles=/home/db1/oracle/oradata/newrsb/jyc01.dbf
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
ORA-39123: Data Pump transportable tablespace job aborted
ORA-01565: error in identifying file '/home/db1/oracle/oradata/newrsb/jyc01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at 12:10:41[oracle@11g bak]$ ll /home/db1/oracle/oradata/newrsb/jyc01.dbf
ls: cannot access /home/db1/oracle/oradata/newrsb/jyc01.dbf: No such file or directory
[oracle@11g bak]$ rman target /Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb 20 12:11:19 2024Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.connected to target database: NEWRSB (DBID=3070027563)RMAN> exitRecovery Manager complete.
[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:13:37 2024Copyright (c) 1982, 2009, 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 optionsSQL> show parameter name;NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string newrsb
db_unique_name string newrsb
global_names boolean FALSE
instance_name string newrsb
lock_name_space string
log_file_name_convert string
service_names string newrsb
SQL> @r0.sqlPL/SQL procedure successfully completed.SQL>
SQL>
SQL> @r1_1.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiecePL/SQL procedure successfully completed.SQL> @r1_2.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiecePL/SQL procedure successfully completed.SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ impdp \'/ as sysdba\' dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles='/home/db1/oracle/oradata/newrsb/jyc01.dbf'Import: Release 11.2.0.1.0 - Production on Tue Feb 20 12:16:14 2024Copyright (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 "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01": "/******** AS SYSDBA" dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles=/home/db1/oracle/oradata/newrsb/jyc01.dbf
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 12:16:15[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:16:45 2024Copyright (c) 1982, 2009, 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 optionsSQL> select TABLESPACE_NAME,STATUS from dba_tablespaces;TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
JYC READ ONLY6 rows selected.SQL> drop tablespace jyc including contents and datafiles;Tablespace dropped.SQL> select TABLESPACE_NAME,STATUS from dba_tablespaces;TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINESQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 210704056 Dec 15 10:06 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwsr-s--x 1 oracle oinstall 199558504 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.bak
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracleO
[oracle@11g bak]$ ll $ORACLE_HOME/bin/impdp*
-rwxr-x--x 1 oracle oinstall 179136 Feb 19 17:00 /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp
-rwxr-x--x 1 oracle oinstall 179144 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp.bak
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdpO
[oracle@11g bak]$ cp /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp.ee
[oracle@11g bak]$ cp /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp.bak /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp.se
[oracle@11g bak]$ mv /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp.bak /home/db1/oracle/product/11.2.0/dbhome_1/bin/impdp
[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:18:25 2024Copyright (c) 1982, 2009, 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 optionsSQL> @r0.sqlPL/SQL procedure successfully completed.SQL> @r1_1.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiecePL/SQL procedure successfully completed.SQL> @r1_2.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiecePL/SQL procedure successfully completed.SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ impdp \'/ as sysdba\' dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles='/home/db1/oracle/oradata/newrsb/jyc01.dbf'Import: Release 11.2.0.1.0 - Production on Tue Feb 20 12:18:50 2024Copyright (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 "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01": "/******** AS SYSDBA" dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles=/home/db1/oracle/oradata/newrsb/jyc01.dbf
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 12:18:51[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:19:05 2024Copyright (c) 1982, 2009, 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 optionsSQL> drop tablespace jyc including contents and datafiles;Tablespace dropped.SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 210704056 Dec 15 10:06 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwsr-s--x 1 oracle oinstall 199558504 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.bak
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracleO
[oracle@11g bak]$ cp /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee
[oracle@11g bak]$ cp /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.bak /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se
[oracle@11g bak]$ mv /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.bak /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
[oracle@11g bak]$ ps -ef|grep ora_smon
oracle 11268 1 0 12:10 ? 00:00:00 ora_smon_newrsb
oracle 11943 4940 0 12:20 pts/1 00:00:00 grep --color=auto ora_smon
[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:20:06 2024Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit ProductionSQL> @r_0.sql
SP2-0310: unable to open file "r_0.sql"
SQL> @r0.sqlPL/SQL procedure successfully completed.SQL> @r1_1.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiecePL/SQL procedure successfully completed.SQL> @r1_2.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiecePL/SQL procedure successfully completed.SQL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - ProductionSQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
[oracle@11g bak]$ impdp \'/ as sysdba\' dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles='/home/db1/oracle/oradata/newrsb/jyc01.dbf'Import: Release 11.2.0.1.0 - Production on Tue Feb 20 12:20:46 2024Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.Connected to: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
ORA-39006: internal error[oracle@11g bak]$ impdp \'/ as sysdba\' dumpfile=se-tts.dmp logfile=tts-imp1.log directory=dmp transport_datafiles='/home/db1/oracle/oradata/newrsb/jyc01.dbf' TRACE=480300Import: Release 11.2.0.1.0 - Production on Tue Feb 20 12:23:24 2024Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.Connected to: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
ORA-39006: internal error[oracle@11g bak]$ cp /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
cp: cannot create regular file ‘/home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle’: Text file busy
[oracle@11g bak]$ cp -p /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
cp: cannot create regular file ‘/home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle’: Text file busy
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 199558504 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwxr-x--x 1 oracle oinstall 210704056 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracleO
-rwxr-x--x 1 oracle oinstall 199558504 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se
[oracle@11g bak]$ chmod 6751 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee
[oracle@11g bak]$ chmod 6751 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 199558504 Feb 19 14:15 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwsr-s--x 1 oracle oinstall 210704056 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracleO
-rwsr-s--x 1 oracle oinstall 199558504 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se
[oracle@11g bak]$ cp -p /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
cp: cannot create regular file ‘/home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle’: Text file busy
[oracle@11g bak]$ cp -p /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee.bak
[oracle@11g bak]$ mv /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
[oracle@11g bak]$ ll $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 210704056 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
-rwsr-s--x 1 oracle oinstall 210704056 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.ee.bak
-rwxr-x--- 1 oracle oinstall 0 Aug 15 2009 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracleO
-rwsr-s--x 1 oracle oinstall 199558504 Feb 20 12:19 /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se
[oracle@11g bak]$ impdp \'/ as sysdba\' dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles='/home/db1/oracle/oradata/newrsb/jyc01.dbf'Import: Release 11.2.0.1.0 - Production on Tue Feb 20 12:28:36 2024Copyright (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 "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01": "/******** AS SYSDBA" dumpfile=se-tts.dmp logfile=tts-imp2.log directory=dmp transport_datafiles=/home/db1/oracle/oradata/newrsb/jyc01.dbf
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 12:28:37[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:32:01 2024Copyright (c) 1982, 2009, 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 optionsSQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:34:35 2024Copyright (c) 1982, 2009, 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 optionsSQL> alter tablespace jyc read write;Tablespace altered.SQL> conn jyc/jyc
Connected.
SQL> create table j (id int);Table created.SQL> insert into j values(1);1 row created.SQL> commit;Commit complete.SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ cp -p /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se.bak
[oracle@11g bak]$ mv /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle.se /home/db1/oracle/product/11.2.0/dbhome_1/bin/oracle
[oracle@11g bak]$ sqlplus jyc/jycSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:36:54 2024Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit ProductionSQL> drop table j;Table dropped.SQL> create table j (id int);Table created.SQL> insert into j values(1);1 row created.SQL> commit;Commit complete.SQL> drop table j;Table dropped.SQL> create table j (id int);Table created.SQL> select TABLESPACE_NAME,STATUS from dba_tablespaces;TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
JYC ONLINE6 rows selected.SQL>
最后重启一遍标准版oracle,这样alert就不再报错了。
[oracle@11g bak]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 20 12:43:01 2024Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit ProductionSQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.Total System Global Area 3256942592 bytes
Fixed Size 2217752 bytes
Variable Size 1811941608 bytes
Database Buffers 1426063360 bytes
Redo Buffers 16719872 bytes
Database mounted.
Database opened.
SQL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
恢复的脚本如下:
[oracle@11g bak]$ more r0.sql
set serveroutput on;
DECLARE
devtype varchar2(256);
done Boolean;
BEGIN
Devtype:=sys.dbms_backup_restore.deviceAllocate (type=>'',ident=>'t1');
sys.dbms_backup_restore.restoreSetDatafile;
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>5,toname=>'/home/db1/oracle/oradata/newrsb/jyc01.dbf');
sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/bak/rsb0_012jhonj_1_1',params=>null);
sys.dbms_backup_restore.deviceDeallocate;
END;
/
[oracle@11g bak]$ more r1_1.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db1/oracle/oradata/newrsb/jyc01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,st
amp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/rsb1_1',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/
[oracle@11g bak]$ more r1_2.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db1/oracle/oradata/newrsb/jyc01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,st
amp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/rsb1_2',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/