|
1Z0-053第19章
1Z0-052共19章(上完16章),1Z0-053共21章(上完17章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的33章
关于4K硬盘:
- select * from v$log;
- select * from v$logfile;
- alter database add logfile group 4
- '/u01/app/oracle/oradata/orcl/redo04.log' blocksize 4096;
复制代码
关于自包含集检查的截屏:
- select tablespace_name,status
- from dba_Tablespaces;
-
- alter tablespace tbsutf8_11g read write;
-
- select * from v$transportable_platform;
-
- alter tablespace tbsutf read write ;
-
- select * from hr.tutf;
复制代码- SQL> exit
- Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- [oracle@station26 mydir]$ impdp system/oracle_4U directory=mydir dumpfile=orcl.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/tbsorcl01.dbf'
- Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:03:55 2017
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- UDI-28002: operation generated ORACLE error 28002
- ORA-28002: the password will expire within 4 days
- Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
- Source time zone version is 11 and target time zone version is 18.
- import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
- export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
- WARNING: possible data loss in character set conversions
- Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/******** directory=mydir dumpfile=orcl.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/tbsorcl01.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 Mon Dec 11 21:04:00 2017 elapsed 0 00:00:02
- [oracle@station26 mydir]$ ls
- afiedt.buf import.log orcl.dmp utf.dmp
- [oracle@station26 mydir]$ cp /mnt/UTF
- UTF2.DMP UTF.DMP
- [oracle@station26 mydir]$ cp /mnt/UTF
- UTF2.DMP UTF.DMP
- [oracle@station26 mydir]$ cp /mnt/UTF2.DMP utf2.dmp
- [oracle@station26 mydir]$ cd /u01/app/oracle/oradata/orcl/
- [oracle@station26 orcl]$ ls
- a.txt redo01.log sysaux01.dbf tbs3.dbf tbsorcl01.dbf undotbs01.dbf
- control01.ctl redo02.log system01.dbf tbs4.dbf tbsutf8_11g01.dbf users01.dbf
- example01.dbf redo03.log tbs3b.dbf tbsaudit01.dbf temp01.dbf
- [oracle@station26 orcl]$ cp /mnt/
- A.DBF export.log TBSORCL01.DBF TBSUTF8_11G01.DBF UTF.DMP
- B.DBF ORCL.DMP TBSUTF01.DBF UTF2.DMP Windows版Client/
- [oracle@station26 orcl]$ cp /mnt/A.DBF a.dbf
- [oracle@station26 orcl]$ cp /mnt/B.DBF b.dbf
- [oracle@station26 orcl]$ ls
- a.dbf example01.dbf sysaux01.dbf tbs4.dbf temp01.dbf
- a.txt redo01.log system01.dbf tbsaudit01.dbf undotbs01.dbf
- b.dbf redo02.log tbs3b.dbf tbsorcl01.dbf users01.dbf
- control01.ctl redo03.log tbs3.dbf tbsutf8_11g01.dbf
- [oracle@station26 orcl]$ chmod -x a.dbf
- [oracle@station26 orcl]$ chmod -x b.dbf
- [oracle@station26 orcl]$ ls
- a.dbf example01.dbf sysaux01.dbf tbs4.dbf temp01.dbf
- a.txt redo01.log system01.dbf tbsaudit01.dbf undotbs01.dbf
- b.dbf redo02.log tbs3b.dbf tbsorcl01.dbf users01.dbf
- control01.ctl redo03.log tbs3.dbf tbsutf8_11g01.dbf
- [oracle@station26 orcl]$ impdp system/oracle_4U directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/a.dbf'
- Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:20:12 2017
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- UDI-28002: operation generated ORACLE error 28002
- ORA-28002: the password will expire within 4 days
- Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
- Source time zone version is 11 and target time zone version is 18.
- Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/******** directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/a.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 Mon Dec 11 21:20:15 2017 elapsed 0 00:00:02
- [oracle@station26 orcl]$ sqlplus /nolog
- SQL*Plus: Release 12.1.0.2.0 Production on Mon Dec 11 21:20:48 2017
- Copyright (c) 1982, 2014, Oracle. All rights reserved.
- SQL> conn hr/oracle_4U
- Connected.
- SQL> select * from tutf;
- A
- ----------
- 2
- SQL> conn / as sysdba
- Connected.
- SQL> alter tablespace tbsutf read write ;
- Tablespace altered.
- SQL> drop tablespace tbsutf including contents and datafiles;
- Tablespace dropped.
- SQL> exit
- Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- [oracle@station26 orcl]$ impdp system/oracle_4U directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/b.dbf'
- Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:22:02 2017
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- UDI-28002: operation generated ORACLE error 28002
- ORA-28002: the password will expire within 4 days
- Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
- Source time zone version is 11 and target time zone version is 18.
- Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/******** directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/b.dbf
- Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
- ORA-39123: Data Pump transportable tablespace job aborted
- ORA-01565: error in identifying file '/u01/app/oracle/oradata/orcl/b.dbf'
- ORA-27048: skgfifi: file header information is invalid
- Additional information: 11
- Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at Mon Dec 11 21:22:05 2017 elapsed 0 00:00:01
- [oracle@station26 orcl]$ rman target /
- Recovery Manager: Release 12.1.0.2.0 - Production on Mon Dec 11 21:23:27 2017
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1462673705)
- 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' ;
- Starting conversion at target at 11-DEC-17
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=423 device type=DISK
- channel ORA_DISK_1: starting datafile conversion
- input file name=/u01/app/oracle/oradata/orcl/b.dbf
- converted datafile=/u01/app/oracle/oradata/orcl/c.dbf
- channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
- Finished conversion at target at 11-DEC-17
- RMAN> exit
- Recovery Manager complete.
- [oracle@station26 orcl]$ impdp system/oracle_4U directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/c.dbf'
- Import: Release 12.1.0.2.0 - Production on Mon Dec 11 21:25:30 2017
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- UDI-28002: operation generated ORACLE error 28002
- ORA-28002: the password will expire within 4 days
- Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
- Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
- Source time zone version is 11 and target time zone version is 18.
- Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/******** directory=mydir dumpfile=utf2.dmp TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/c.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 Mon Dec 11 21:25:33 2017 elapsed 0 00:00:02
- [oracle@station26 orcl]$
复制代码 parfile的重要性:
- 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'"
复制代码- directory=dir1
- dumpfile=my2.dmp
- schemas=hr
- job_name=my2_job
- exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')"
- query='employees:where department_id=90'
- flashback_time='2014-10-14:20:34:12'
复制代码- expdp system/oracle_4U parfile=my.txt
复制代码
|
|