Bo's Oracle Station

查看: 1620|回复: 0

课程第57次(2017-11-21星期二)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-11-21 19:56:01 | 显示全部楼层 |阅读模式
1Z0-053第19章
1Z0-05219章(上完16章),1Z0-05321章(上完17章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的33
关于4K硬盘:
  1. select  * from v$log;

  2. select  * from v$logfile;

  3. alter database add logfile group 4
  4.   '/u01/app/oracle/oradata/orcl/redo04.log' blocksize 4096;
复制代码
Screenshot.png

关于自包含集检查的截屏:
Screenshot-1.png

  1. select  tablespace_name,status
  2. from dba_Tablespaces;

  3. alter tablespace  tbsutf8_11g read write;

  4. select  * from v$transportable_platform;

  5. alter tablespace tbsutf read write ;

  6. select * from hr.tutf;
复制代码
  1. SQL> exit
  2. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  3. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  4. [oracle@station26 mydir]$ impdp  system/oracle_4U  directory=mydir dumpfile=orcl.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/tbsorcl01.dbf'

  5. Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:03:55 2017

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

  7. UDI-28002: operation generated ORACLE error 28002
  8. ORA-28002: the password will expire within 4 days

  9. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  10. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  11. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  12. Source time zone version is 11 and target time zone version is 18.
  13. import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
  14. export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
  15. WARNING: possible data loss in character set conversions
  16. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=mydir dumpfile=orcl.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/tbsorcl01.dbf
  17. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  18. ORA-39123: Data Pump transportable tablespace job aborted
  19. ORA-29345: cannot plug a tablespace into a database using an incompatible character set

  20. Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at Mon Dec 11 21:04:00 2017 elapsed 0 00:00:02

  21. [oracle@station26 mydir]$ ls
  22. afiedt.buf  import.log  orcl.dmp  utf.dmp
  23. [oracle@station26 mydir]$ cp /mnt/UTF
  24. UTF2.DMP  UTF.DMP   
  25. [oracle@station26 mydir]$ cp /mnt/UTF
  26. UTF2.DMP  UTF.DMP   
  27. [oracle@station26 mydir]$ cp /mnt/UTF2.DMP   utf2.dmp
  28. [oracle@station26 mydir]$ cd /u01/app/oracle/oradata/orcl/
  29. [oracle@station26 orcl]$ ls
  30. a.txt          redo01.log  sysaux01.dbf  tbs3.dbf        tbsorcl01.dbf      undotbs01.dbf
  31. control01.ctl  redo02.log  system01.dbf  tbs4.dbf        tbsutf8_11g01.dbf  users01.dbf
  32. example01.dbf  redo03.log  tbs3b.dbf     tbsaudit01.dbf  temp01.dbf
  33. [oracle@station26 orcl]$ cp  /mnt/
  34. A.DBF              export.log         TBSORCL01.DBF      TBSUTF8_11G01.DBF  UTF.DMP
  35. B.DBF              ORCL.DMP           TBSUTF01.DBF       UTF2.DMP           Windows版Client/
  36. [oracle@station26 orcl]$ cp  /mnt/A.DBF   a.dbf   
  37. [oracle@station26 orcl]$ cp  /mnt/B.DBF   b.dbf   
  38. [oracle@station26 orcl]$ ls
  39. a.dbf          example01.dbf  sysaux01.dbf  tbs4.dbf           temp01.dbf
  40. a.txt          redo01.log     system01.dbf  tbsaudit01.dbf     undotbs01.dbf
  41. b.dbf          redo02.log     tbs3b.dbf     tbsorcl01.dbf      users01.dbf
  42. control01.ctl  redo03.log     tbs3.dbf      tbsutf8_11g01.dbf
  43. [oracle@station26 orcl]$ chmod -x a.dbf
  44. [oracle@station26 orcl]$ chmod -x b.dbf
  45. [oracle@station26 orcl]$ ls
  46. a.dbf          example01.dbf  sysaux01.dbf  tbs4.dbf           temp01.dbf
  47. a.txt          redo01.log     system01.dbf  tbsaudit01.dbf     undotbs01.dbf
  48. b.dbf          redo02.log     tbs3b.dbf     tbsorcl01.dbf      users01.dbf
  49. control01.ctl  redo03.log     tbs3.dbf      tbsutf8_11g01.dbf
  50. [oracle@station26 orcl]$ impdp  system/oracle_4U  directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/a.dbf'

  51. Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:20:12 2017

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

  53. UDI-28002: operation generated ORACLE error 28002
  54. ORA-28002: the password will expire within 4 days

  55. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  56. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  57. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  58. Source time zone version is 11 and target time zone version is 18.
  59. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/a.dbf
  60. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  61. Processing object type TRANSPORTABLE_EXPORT/TABLE
  62. Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  63. Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Mon Dec 11 21:20:15 2017 elapsed 0 00:00:02

  64. [oracle@station26 orcl]$ sqlplus /nolog

  65. SQL*Plus: Release 12.1.0.2.0 Production on Mon Dec 11 21:20:48 2017

  66. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  67. SQL> conn hr/oracle_4U
  68. Connected.
  69. SQL> select  * from tutf;

  70.          A
  71. ----------
  72.          2

  73. SQL> conn / as sysdba
  74. Connected.
  75. SQL> alter tablespace tbsutf read write ;

  76. Tablespace altered.

  77. SQL> drop tablespace tbsutf including contents and datafiles;

  78. Tablespace dropped.

  79. SQL> exit
  80. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  81. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  82. [oracle@station26 orcl]$ impdp  system/oracle_4U  directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/b.dbf'

  83. Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:22:02 2017

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

  85. UDI-28002: operation generated ORACLE error 28002
  86. ORA-28002: the password will expire within 4 days

  87. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  88. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  89. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  90. Source time zone version is 11 and target time zone version is 18.
  91. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/b.dbf
  92. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  93. ORA-39123: Data Pump transportable tablespace job aborted
  94. ORA-01565: error in identifying file '/u01/app/oracle/oradata/orcl/b.dbf'
  95. ORA-27048: skgfifi: file header information is invalid
  96. Additional information: 11

  97. Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at Mon Dec 11 21:22:05 2017 elapsed 0 00:00:01

  98. [oracle@station26 orcl]$ rman target /

  99. Recovery Manager: Release 12.1.0.2.0 - Production on Mon Dec 11 21:23:27 2017

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

  101. connected to target database: ORCL (DBID=1462673705)

  102. RMAN> convert datafile '/u01/app/oracle/oradata/orcl/b.dbf' from platform 'AIX-Based Systems (64-bit)' format '/u01/app/oracle/oradata/orcl/c.dbf' ;         

  103. Starting conversion at target at 11-DEC-17
  104. using target database control file instead of recovery catalog
  105. allocated channel: ORA_DISK_1
  106. channel ORA_DISK_1: SID=423 device type=DISK
  107. channel ORA_DISK_1: starting datafile conversion
  108. input file name=/u01/app/oracle/oradata/orcl/b.dbf
  109. converted datafile=/u01/app/oracle/oradata/orcl/c.dbf
  110. channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
  111. Finished conversion at target at 11-DEC-17

  112. RMAN> exit


  113. Recovery Manager complete.
  114. [oracle@station26 orcl]$ impdp  system/oracle_4U  directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/c.dbf'

  115. Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:25:30 2017

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

  117. UDI-28002: operation generated ORACLE error 28002
  118. ORA-28002: the password will expire within 4 days

  119. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  120. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  121. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  122. Source time zone version is 11 and target time zone version is 18.
  123. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/c.dbf
  124. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  125. Processing object type TRANSPORTABLE_EXPORT/TABLE
  126. Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  127. Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Mon Dec 11 21:25:33 2017 elapsed 0 00:00:02

  128. [oracle@station26 orcl]$
复制代码
parfile的重要性:
  1. expdp hr/oracle_4U directory=dir1 dumpfile=my.dmp  schemas=hr job_name=my_job  exclude=table:"in \(\'T_BANK_INVOICE\'\)", procedure:" in \(\'SECURE_DML\'\)"  "query='employees:where department_id=90'"
复制代码
  1. directory=dir1
  2. dumpfile=my2.dmp  
  3. schemas=hr
  4. job_name=my2_job  
  5. exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')"  
  6. query='employees:where department_id=90'
  7. flashback_time='2014-10-14:20:34:12'
复制代码
  1. expdp system/oracle_4U  parfile=my.txt
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 07:38 , Processed in 0.134669 second(s), 27 queries .

快速回复 返回顶部 返回列表