Bo's Oracle Station

查看: 1485|回复: 0

课程第65次(2017-08-10星期四)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-8-10 19:36:26 | 显示全部楼层 |阅读模式
上完1Z0-063多租户部分第6章
1Z0-063多租户部分共9章(上完6章)
总共上完全部49章中的46

不管是对象权限还是系统权限都不分通用还是本地:
  1. select  * from system_privilege_map order by 1;
  2. select  * from table_privilege_map order by 1;
复制代码
在根容器上的非SYS用户,看别的容器里的信息:
  1. select  * from cdb_sys_privs sp
  2. where sp.GRANTEE in('C##_USER','LOCAL_USER_PDB2')
  3. order by con_id;

  4. ---
  5. grant create table , unlimited tablespace to c##_user
  6. container=all;

  7.   select  * from cdb_sys_privs sp
  8. where sp.GRANTEE in('C##_USER')
  9. order by con_id,2;
  10. ----
  11.   grant create sequence to c##_user container=current;
  12.   ---
  13.     select  * from cdb_sys_privs sp
  14. where sp.GRANTEE in('C##_USER')
  15. order by con_id,2;

  16. ----

  17. SELECT USERNAME, DEFAULT_ATTR, OWNER, OBJECT_NAME,
  18. ALL_CONTAINERS, CONTAINER_NAME, CON_ID
  19. FROM CDB_CONTAINER_DATA
  20. WHERE username NOT IN
  21. ('GSMADMIN_INTERNAL', 'APPQOSSYS', 'DBSNMP')
  22. ORDER BY OBJECT_NAME;

  23. ------
  24. CREATE USER c##jfv IDENTIFIED BY oracle_4U;

  25. GRANT CREATE SESSION, SET CONTAINER TO c##jfv
  26. CONTAINER=ALL;
  27. ----------
  28. select  *
  29.    from cdb_sys_privs  where grantee='C##JFV'
  30.    order by con_id;
  31. -----
  32. grant select  on sys.v_$session to c##jfv ;

  33. select  *
  34.    from cdb_tab_privs  where grantee='C##JFV'
  35.    order by con_id;
  36.   
  37.   revoke  select  on sys.v_$session from c##jfv ;
  38.    
  39. grant select  on sys.v_$session to c##jfv  container=all ;  

  40. select  *
  41.    from cdb_tab_privs  where grantee='C##JFV'
  42.    order by con_id;
  43.    -------------------------
  44.    
  45.    SELECT username, con_id FROM v_$session
  46. WHERE username IS NOT NULL AND username <> 'DBSNMP';

  47.    -------------------------
  48.    alter user c##jfv
  49.   set container_data=(cdb$root,pdb1_1,pdb2_2)
  50.   for v_$session
  51.   container=current;
  52. ---------------------
  53. SELECT USERNAME, DEFAULT_ATTR, OWNER, OBJECT_NAME,
  54. ALL_CONTAINERS, CONTAINER_NAME, CON_ID
  55. FROM CDB_CONTAINER_DATA
  56. WHERE username NOT IN
  57. ('GSMADMIN_INTERNAL', 'APPQOSSYS', 'DBSNMP')
  58. ORDER BY OBJECT_NAME;
复制代码
Screenshot.png

回收空间,准备下面的实验(与CDB/PDB内容无关):
  1. SQL> drop diskgroup  fra including contents;

  2. Diskgroup dropped.

  3. SQL> exit
  4. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  5. With the Automatic Storage Management option
  6. [oracle@station26 ~]$ sqlplus /nolog

  7. SQL*Plus: Release 12.1.0.2.0 Production on Thu Aug 10 20:28:54 2017

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

  9. SQL> conn / as sysdba
  10. Connected.
  11. SQL> desc v$asm_disk;
  12. Name                                           Null?    Type
  13. ----------------------------------------- -------- ----------------------------
  14. GROUP_NUMBER                                            NUMBER
  15. DISK_NUMBER                                            NUMBER
  16. COMPOUND_INDEX                                     NUMBER
  17. INCARNATION                                            NUMBER
  18. MOUNT_STATUS                                            VARCHAR2(7)
  19. HEADER_STATUS                                            VARCHAR2(12)
  20. MODE_STATUS                                            VARCHAR2(7)
  21. STATE                                                    VARCHAR2(8)
  22. REDUNDANCY                                            VARCHAR2(7)
  23. LIBRARY                                            VARCHAR2(64)
  24. OS_MB                                                    NUMBER
  25. TOTAL_MB                                            NUMBER
  26. FREE_MB                                            NUMBER
  27. HOT_USED_MB                                            NUMBER
  28. COLD_USED_MB                                            NUMBER
  29. NAME                                                    VARCHAR2(30)
  30. FAILGROUP                                            VARCHAR2(30)
  31. LABEL                                                    VARCHAR2(31)
  32. PATH                                                    VARCHAR2(256)
  33. UDID                                                    VARCHAR2(64)
  34. PRODUCT                                            VARCHAR2(32)
  35. CREATE_DATE                                            DATE
  36. MOUNT_DATE                                            DATE
  37. REPAIR_TIMER                                            NUMBER
  38. READS                                                    NUMBER
  39. WRITES                                             NUMBER
  40. READ_ERRS                                            NUMBER
  41. WRITE_ERRS                                            NUMBER
  42. READ_TIMEOUT                                            NUMBER
  43. WRITE_TIMEOUT                                            NUMBER
  44. READ_TIME                                            NUMBER
  45. WRITE_TIME                                            NUMBER
  46. BYTES_READ                                            NUMBER
  47. BYTES_WRITTEN                                            NUMBER
  48. PREFERRED_READ                                     VARCHAR2(1)
  49. HASH_VALUE                                            NUMBER
  50. HOT_READS                                            NUMBER
  51. HOT_WRITES                                            NUMBER
  52. HOT_BYTES_READ                                     NUMBER
  53. HOT_BYTES_WRITTEN                                    NUMBER
  54. COLD_READS                                            NUMBER
  55. COLD_WRITES                                            NUMBER
  56. COLD_BYTES_READ                                    NUMBER
  57. COLD_BYTES_WRITTEN                                    NUMBER
  58. VOTING_FILE                                            VARCHAR2(1)
  59. SECTOR_SIZE                                            NUMBER
  60. FAILGROUP_TYPE                                     VARCHAR2(7)
  61. CON_ID                                             NUMBER

  62. SQL> select  GROUP_NUMBER  , group_name from v$asm_diskgroup;
  63. select        GROUP_NUMBER  , group_name from v$asm_diskgroup
  64.                         *
  65. ERROR at line 1:
  66. ORA-00904: "GROUP_NAME": invalid identifier


  67. SQL> desc v$asm_diskgroup   
  68. Name                                           Null?    Type
  69. ----------------------------------------- -------- ----------------------------
  70. GROUP_NUMBER                                            NUMBER
  71. NAME                                                    VARCHAR2(30)
  72. SECTOR_SIZE                                            NUMBER
  73. BLOCK_SIZE                                            NUMBER
  74. ALLOCATION_UNIT_SIZE                                    NUMBER
  75. STATE                                                    VARCHAR2(11)
  76. TYPE                                                    VARCHAR2(6)
  77. TOTAL_MB                                            NUMBER
  78. FREE_MB                                            NUMBER
  79. HOT_USED_MB                                            NUMBER
  80. COLD_USED_MB                                            NUMBER
  81. REQUIRED_MIRROR_FREE_MB                            NUMBER
  82. USABLE_FILE_MB                                     NUMBER
  83. OFFLINE_DISKS                                            NUMBER
  84. COMPATIBILITY                                            VARCHAR2(60)
  85. DATABASE_COMPATIBILITY                             VARCHAR2(60)
  86. VOTING_FILES                                            VARCHAR2(1)
  87. CON_ID                                             NUMBER

  88. SQL>  select  GROUP_NUMBER  , name from v$asm_diskgroup;

  89. GROUP_NUMBER
  90. ------------
  91. NAME
  92. --------------------------------------------------------------------------------
  93.            1
  94. DATA


  95. SQL> select  parth from v$asm_disk where group_number <> 1 ;
  96. select        parth from v$asm_disk where group_number <> 1
  97.         *
  98. ERROR at line 1:
  99. ORA-00904: "PARTH": invalid identifier


  100. SQL> select  path from v$asm_disk where group_number <> 1 ;

  101. PATH
  102. --------------------------------------------------------------------------------
  103. ORCL:ASMDISK05

  104. SQL> exit
  105. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  106. With the Automatic Storage Management option
  107. [oracle@station26 ~]$ exit
  108. logout
  109. [root@station26 oracle]# oracleasm-discover
  110. Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
  111. [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
  112. Discovered disk: ORCL:ASMDISK01 [14336000 blocks (7340032000 bytes), maxio 512]
  113. Discovered disk: ORCL:ASMDISK02 [14336000 blocks (7340032000 bytes), maxio 512]
  114. Discovered disk: ORCL:ASMDISK03 [14336000 blocks (7340032000 bytes), maxio 512]
  115. Discovered disk: ORCL:ASMDISK04 [14336000 blocks (7340032000 bytes), maxio 512]
  116. Discovered disk: ORCL:ASMDISK05 [20480000 blocks (10485760000 bytes), maxio 512]
  117. [root@station26 oracle]# oracleasm  -h
  118. Usage: oracleasm [--exec-path=<exec_path>] <command> [ <args> ]
  119.        oracleasm --exec-path
  120.        oracleasm -h
  121.        oracleasm -V

  122. The basic oracleasm commands are:
  123.     configure        Configure the Oracle Linux ASMLib driver
  124.     init             Load and initialize the ASMLib driver
  125.     exit             Stop the ASMLib driver
  126.     scandisks        Scan the system for Oracle ASMLib disks
  127.     status           Display the status of the Oracle ASMLib driver
  128.     listdisks        List known Oracle ASMLib disks
  129.     querydisk        Determine if a disk belongs to Oracle ASMlib
  130.     createdisk       Allocate a device for Oracle ASMLib use
  131.     deletedisk       Return a device to the operating system
  132.     renamedisk       Change the label of an Oracle ASMlib disk
  133.     update-driver    Download the latest ASMLib driver
  134. [root@station26 oracle]# oracleasm  listdisks
  135. ASMDISK01
  136. ASMDISK02
  137. ASMDISK03
  138. ASMDISK04
  139. ASMDISK05
  140. [root@station26 oracle]# oracleasm deletedisk ASMDISK05
  141. Clearing disk header: done
  142. Dropping disk: done
  143. [root@station26 oracle]# cd /dev/oracleasm/disks/
  144. [root@station26 disks]# ls
  145. ASMDISK01  ASMDISK02  ASMDISK03  ASMDISK04
  146. [root@station26 disks]# ls -l
  147. 总用量 0
  148. brw-rw----. 1 oracle asmadmin 250, 5 8月   8 11:48 ASMDISK01
  149. brw-rw----. 1 oracle asmadmin 250, 6 8月   8 11:48 ASMDISK02
  150. brw-rw----. 1 oracle asmadmin 250, 7 8月   8 11:48 ASMDISK03
  151. brw-rw----. 1 oracle asmadmin 250, 8 8月   8 11:48 ASMDISK04
  152. [root@station26 disks]# fdisk -l

  153. Disk /dev/ram0: 16 MB, 16777216 bytes
  154. 255 heads, 63 sectors/track, 2 cylinders
  155. Units = cylinders of 16065 * 512 = 8225280 bytes
  156. Sector size (logical/physical): 512 bytes / 4096 bytes
  157. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  158. Disk identifier: 0x00000000


  159. Disk /dev/ram1: 16 MB, 16777216 bytes
  160. 255 heads, 63 sectors/track, 2 cylinders
  161. Units = cylinders of 16065 * 512 = 8225280 bytes
  162. Sector size (logical/physical): 512 bytes / 4096 bytes
  163. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  164. Disk identifier: 0x00000000


  165. Disk /dev/ram2: 16 MB, 16777216 bytes
  166. 255 heads, 63 sectors/track, 2 cylinders
  167. Units = cylinders of 16065 * 512 = 8225280 bytes
  168. Sector size (logical/physical): 512 bytes / 4096 bytes
  169. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  170. Disk identifier: 0x00000000


  171. Disk /dev/ram3: 16 MB, 16777216 bytes
  172. 255 heads, 63 sectors/track, 2 cylinders
  173. Units = cylinders of 16065 * 512 = 8225280 bytes
  174. Sector size (logical/physical): 512 bytes / 4096 bytes
  175. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  176. Disk identifier: 0x00000000


  177. Disk /dev/ram4: 16 MB, 16777216 bytes
  178. 255 heads, 63 sectors/track, 2 cylinders
  179. Units = cylinders of 16065 * 512 = 8225280 bytes
  180. Sector size (logical/physical): 512 bytes / 4096 bytes
  181. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  182. Disk identifier: 0x00000000


  183. Disk /dev/ram5: 16 MB, 16777216 bytes
  184. 255 heads, 63 sectors/track, 2 cylinders
  185. Units = cylinders of 16065 * 512 = 8225280 bytes
  186. Sector size (logical/physical): 512 bytes / 4096 bytes
  187. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  188. Disk identifier: 0x00000000


  189. Disk /dev/ram6: 16 MB, 16777216 bytes
  190. 255 heads, 63 sectors/track, 2 cylinders
  191. Units = cylinders of 16065 * 512 = 8225280 bytes
  192. Sector size (logical/physical): 512 bytes / 4096 bytes
  193. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  194. Disk identifier: 0x00000000


  195. Disk /dev/ram7: 16 MB, 16777216 bytes
  196. 255 heads, 63 sectors/track, 2 cylinders
  197. Units = cylinders of 16065 * 512 = 8225280 bytes
  198. Sector size (logical/physical): 512 bytes / 4096 bytes
  199. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  200. Disk identifier: 0x00000000


  201. Disk /dev/ram8: 16 MB, 16777216 bytes
  202. 255 heads, 63 sectors/track, 2 cylinders
  203. Units = cylinders of 16065 * 512 = 8225280 bytes
  204. Sector size (logical/physical): 512 bytes / 4096 bytes
  205. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  206. Disk identifier: 0x00000000


  207. Disk /dev/ram9: 16 MB, 16777216 bytes
  208. 255 heads, 63 sectors/track, 2 cylinders
  209. Units = cylinders of 16065 * 512 = 8225280 bytes
  210. Sector size (logical/physical): 512 bytes / 4096 bytes
  211. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  212. Disk identifier: 0x00000000


  213. Disk /dev/ram10: 16 MB, 16777216 bytes
  214. 255 heads, 63 sectors/track, 2 cylinders
  215. Units = cylinders of 16065 * 512 = 8225280 bytes
  216. Sector size (logical/physical): 512 bytes / 4096 bytes
  217. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  218. Disk identifier: 0x00000000


  219. Disk /dev/ram11: 16 MB, 16777216 bytes
  220. 255 heads, 63 sectors/track, 2 cylinders
  221. Units = cylinders of 16065 * 512 = 8225280 bytes
  222. Sector size (logical/physical): 512 bytes / 4096 bytes
  223. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  224. Disk identifier: 0x00000000


  225. Disk /dev/ram12: 16 MB, 16777216 bytes
  226. 255 heads, 63 sectors/track, 2 cylinders
  227. Units = cylinders of 16065 * 512 = 8225280 bytes
  228. Sector size (logical/physical): 512 bytes / 4096 bytes
  229. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  230. Disk identifier: 0x00000000


  231. Disk /dev/ram13: 16 MB, 16777216 bytes
  232. 255 heads, 63 sectors/track, 2 cylinders
  233. Units = cylinders of 16065 * 512 = 8225280 bytes
  234. Sector size (logical/physical): 512 bytes / 4096 bytes
  235. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  236. Disk identifier: 0x00000000


  237. Disk /dev/ram14: 16 MB, 16777216 bytes
  238. 255 heads, 63 sectors/track, 2 cylinders
  239. Units = cylinders of 16065 * 512 = 8225280 bytes
  240. Sector size (logical/physical): 512 bytes / 4096 bytes
  241. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  242. Disk identifier: 0x00000000


  243. Disk /dev/ram15: 16 MB, 16777216 bytes
  244. 255 heads, 63 sectors/track, 2 cylinders
  245. Units = cylinders of 16065 * 512 = 8225280 bytes
  246. Sector size (logical/physical): 512 bytes / 4096 bytes
  247. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  248. Disk identifier: 0x00000000


  249. Disk /dev/vda: 96.6 GB, 96636764160 bytes
  250. 16 heads, 63 sectors/track, 187245 cylinders
  251. Units = cylinders of 1008 * 512 = 516096 bytes
  252. Sector size (logical/physical): 512 bytes / 512 bytes
  253. I/O size (minimum/optimal): 512 bytes / 512 bytes
  254. Disk identifier: 0x000e4c21

  255.    Device Boot      Start         End      Blocks   Id  System
  256. /dev/vda1   *           3         612      307200   83  Linux
  257. Partition 1 does not end on cylinder boundary.
  258. /dev/vda2             612       93666    46899200   8e  Linux LVM
  259. Partition 2 does not end on cylinder boundary.
  260. /dev/vda3           93666      113983    10240000   8e  Linux LVM
  261. Partition 3 does not end on cylinder boundary.
  262. /dev/vda4          113983      187246    36924416    5  Extended
  263. Partition 4 does not end on cylinder boundary.
  264. /dev/vda5          113988      128210     7168000   8e  Linux LVM
  265. /dev/vda6          128212      142434     7168000   8e  Linux LVM
  266. /dev/vda7          142436      156658     7168000   8e  Linux LVM
  267. /dev/vda8          156660      170883     7168000   8e  Linux LVM
  268. /dev/vda9          170885      179207     4194304   82  Linux swap / Solaris

  269. Disk /dev/mapper/RAC12crhel6-root: 47.9 GB, 47949283328 bytes
  270. 255 heads, 63 sectors/track, 5829 cylinders
  271. Units = cylinders of 16065 * 512 = 8225280 bytes
  272. Sector size (logical/physical): 512 bytes / 512 bytes
  273. I/O size (minimum/optimal): 512 bytes / 512 bytes
  274. Disk identifier: 0x00000000

  275. [root@station26 disks]# fdisk -l

  276. Disk /dev/ram0: 16 MB, 16777216 bytes
  277. 255 heads, 63 sectors/track, 2 cylinders
  278. Units = cylinders of 16065 * 512 = 8225280 bytes
  279. Sector size (logical/physical): 512 bytes / 4096 bytes
  280. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  281. Disk identifier: 0x00000000


  282. Disk /dev/ram1: 16 MB, 16777216 bytes
  283. 255 heads, 63 sectors/track, 2 cylinders
  284. Units = cylinders of 16065 * 512 = 8225280 bytes
  285. Sector size (logical/physical): 512 bytes / 4096 bytes
  286. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  287. Disk identifier: 0x00000000


  288. Disk /dev/ram2: 16 MB, 16777216 bytes
  289. 255 heads, 63 sectors/track, 2 cylinders
  290. Units = cylinders of 16065 * 512 = 8225280 bytes
  291. Sector size (logical/physical): 512 bytes / 4096 bytes
  292. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  293. Disk identifier: 0x00000000


  294. Disk /dev/ram3: 16 MB, 16777216 bytes
  295. 255 heads, 63 sectors/track, 2 cylinders
  296. Units = cylinders of 16065 * 512 = 8225280 bytes
  297. Sector size (logical/physical): 512 bytes / 4096 bytes
  298. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  299. Disk identifier: 0x00000000


  300. Disk /dev/ram4: 16 MB, 16777216 bytes
  301. 255 heads, 63 sectors/track, 2 cylinders
  302. Units = cylinders of 16065 * 512 = 8225280 bytes
  303. Sector size (logical/physical): 512 bytes / 4096 bytes
  304. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  305. Disk identifier: 0x00000000


  306. Disk /dev/ram5: 16 MB, 16777216 bytes
  307. 255 heads, 63 sectors/track, 2 cylinders
  308. Units = cylinders of 16065 * 512 = 8225280 bytes
  309. Sector size (logical/physical): 512 bytes / 4096 bytes
  310. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  311. Disk identifier: 0x00000000


  312. Disk /dev/ram6: 16 MB, 16777216 bytes
  313. 255 heads, 63 sectors/track, 2 cylinders
  314. Units = cylinders of 16065 * 512 = 8225280 bytes
  315. Sector size (logical/physical): 512 bytes / 4096 bytes
  316. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  317. Disk identifier: 0x00000000


  318. Disk /dev/ram7: 16 MB, 16777216 bytes
  319. 255 heads, 63 sectors/track, 2 cylinders
  320. Units = cylinders of 16065 * 512 = 8225280 bytes
  321. Sector size (logical/physical): 512 bytes / 4096 bytes
  322. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  323. Disk identifier: 0x00000000


  324. Disk /dev/ram8: 16 MB, 16777216 bytes
  325. 255 heads, 63 sectors/track, 2 cylinders
  326. Units = cylinders of 16065 * 512 = 8225280 bytes
  327. Sector size (logical/physical): 512 bytes / 4096 bytes
  328. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  329. Disk identifier: 0x00000000


  330. Disk /dev/ram9: 16 MB, 16777216 bytes
  331. 255 heads, 63 sectors/track, 2 cylinders
  332. Units = cylinders of 16065 * 512 = 8225280 bytes
  333. Sector size (logical/physical): 512 bytes / 4096 bytes
  334. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  335. Disk identifier: 0x00000000


  336. Disk /dev/ram10: 16 MB, 16777216 bytes
  337. 255 heads, 63 sectors/track, 2 cylinders
  338. Units = cylinders of 16065 * 512 = 8225280 bytes
  339. Sector size (logical/physical): 512 bytes / 4096 bytes
  340. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  341. Disk identifier: 0x00000000


  342. Disk /dev/ram11: 16 MB, 16777216 bytes
  343. 255 heads, 63 sectors/track, 2 cylinders
  344. Units = cylinders of 16065 * 512 = 8225280 bytes
  345. Sector size (logical/physical): 512 bytes / 4096 bytes
  346. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  347. Disk identifier: 0x00000000


  348. Disk /dev/ram12: 16 MB, 16777216 bytes
  349. 255 heads, 63 sectors/track, 2 cylinders
  350. Units = cylinders of 16065 * 512 = 8225280 bytes
  351. Sector size (logical/physical): 512 bytes / 4096 bytes
  352. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  353. Disk identifier: 0x00000000


  354. Disk /dev/ram13: 16 MB, 16777216 bytes
  355. 255 heads, 63 sectors/track, 2 cylinders
  356. Units = cylinders of 16065 * 512 = 8225280 bytes
  357. Sector size (logical/physical): 512 bytes / 4096 bytes
  358. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  359. Disk identifier: 0x00000000


  360. Disk /dev/ram14: 16 MB, 16777216 bytes
  361. 255 heads, 63 sectors/track, 2 cylinders
  362. Units = cylinders of 16065 * 512 = 8225280 bytes
  363. Sector size (logical/physical): 512 bytes / 4096 bytes
  364. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  365. Disk identifier: 0x00000000


  366. Disk /dev/ram15: 16 MB, 16777216 bytes
  367. 255 heads, 63 sectors/track, 2 cylinders
  368. Units = cylinders of 16065 * 512 = 8225280 bytes
  369. Sector size (logical/physical): 512 bytes / 4096 bytes
  370. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  371. Disk identifier: 0x00000000


  372. Disk /dev/vda: 96.6 GB, 96636764160 bytes
  373. 16 heads, 63 sectors/track, 187245 cylinders
  374. Units = cylinders of 1008 * 512 = 516096 bytes
  375. Sector size (logical/physical): 512 bytes / 512 bytes
  376. I/O size (minimum/optimal): 512 bytes / 512 bytes
  377. Disk identifier: 0x000e4c21

  378.    Device Boot      Start         End      Blocks   Id  System
  379. /dev/vda1   *           3         612      307200   83  Linux
  380. Partition 1 does not end on cylinder boundary.
  381. /dev/vda2             612       93666    46899200   8e  Linux LVM
  382. Partition 2 does not end on cylinder boundary.
  383. /dev/vda3           93666      113983    10240000   8e  Linux LVM
  384. Partition 3 does not end on cylinder boundary.
  385. /dev/vda4          113983      187246    36924416    5  Extended
  386. Partition 4 does not end on cylinder boundary.
  387. /dev/vda5          113988      128210     7168000   8e  Linux LVM
  388. /dev/vda6          128212      142434     7168000   8e  Linux LVM
  389. /dev/vda7          142436      156658     7168000   8e  Linux LVM
  390. /dev/vda8          156660      170883     7168000   8e  Linux LVM
  391. /dev/vda9          170885      179207     4194304   82  Linux swap / Solaris

  392. Disk /dev/mapper/RAC12crhel6-root: 47.9 GB, 47949283328 bytes
  393. 255 heads, 63 sectors/track, 5829 cylinders
  394. Units = cylinders of 16065 * 512 = 8225280 bytes
  395. Sector size (logical/physical): 512 bytes / 512 bytes
  396. I/O size (minimum/optimal): 512 bytes / 512 bytes
  397. Disk identifier: 0x00000000

  398. [root@station26 disks]# su - oracle
  399. [oracle@station26 ~]$ exit
  400. logout
  401. [root@station26 disks]# ls  -l
  402. 总用量 0
  403. brw-rw----. 1 oracle asmadmin 250, 5 8月   8 11:48 ASMDISK01
  404. brw-rw----. 1 oracle asmadmin 250, 6 8月   8 11:48 ASMDISK02
  405. brw-rw----. 1 oracle asmadmin 250, 7 8月   8 11:48 ASMDISK03
  406. brw-rw----. 1 oracle asmadmin 250, 8 8月   8 11:48 ASMDISK04
  407. [root@station26 disks]# ls -l /dev/vda8
  408. brw-rw----. 1 root disk 250, 8 8月   8 11:48 /dev/vda8
  409. [root@station26 disks]# ls -l /dev/vda*
  410. brw-rw----. 1 root disk 250, 0 8月   8 11:48 /dev/vda
  411. brw-rw----. 1 root disk 250, 1 8月   8 11:48 /dev/vda1
  412. brw-rw----. 1 root disk 250, 2 8月   8 11:48 /dev/vda2
  413. brw-rw----. 1 root disk 250, 3 8月   8 11:48 /dev/vda3
  414. brw-rw----. 1 root disk 250, 4 8月   8 11:48 /dev/vda4
  415. brw-rw----. 1 root disk 250, 5 8月   8 11:48 /dev/vda5
  416. brw-rw----. 1 root disk 250, 6 8月   8 11:48 /dev/vda6
  417. brw-rw----. 1 root disk 250, 7 8月   8 11:48 /dev/vda7
  418. brw-rw----. 1 root disk 250, 8 8月   8 11:48 /dev/vda8
  419. brw-rw----. 1 root disk 250, 9 8月   8 11:48 /dev/vda9
  420. [root@station26 disks]# df -h
  421. Filesystem            Size  Used Avail Use% Mounted on
  422. /dev/mapper/RAC12crhel6-root
  423.                        44G   41G  1.5G  97% /
  424. tmpfs                 9.5G  2.0G  7.6G  21% /dev/shm
  425. /dev/vda1             283M  114M  150M  44% /boot
  426. [root@station26 disks]# pvs
  427.   PV         VG          Fmt  Attr PSize  PFree
  428.   /dev/vda2  RAC12crhel6 lvm2 a--u 44.72g 64.00m
  429. [root@station26 disks]# pvcreate /dev/vda3  
  430.   Physical volume "/dev/vda3" successfully created
  431. [root@station26 disks]# vgs
  432.   VG          #PV #LV #SN Attr   VSize  VFree
  433.   RAC12crhel6   1   1   0 wz--n- 44.72g 64.00m
  434. [root@station26 disks]# vgextend   RAC12crhel6   /dev/vda3
  435.   Volume group "RAC12crhel6" successfully extended
  436. [root@station26 disks]# vgdisplay
  437.   --- Volume group ---
  438.   VG Name               RAC12crhel6
  439.   System ID            
  440.   Format                lvm2
  441.   Metadata Areas        2
  442.   Metadata Sequence No  3
  443.   VG Access             read/write
  444.   VG Status             resizable
  445.   MAX LV                0
  446.   Cur LV                1
  447.   Open LV               1
  448.   Max PV                0
  449.   Cur PV                2
  450.   Act PV                2
  451.   VG Size               54.47 GiB
  452.   PE Size               32.00 MiB
  453.   Total PE              1743
  454.   Alloc PE / Size       1429 / 44.66 GiB
  455.   Free  PE / Size       314 / 9.81 GiB
  456.   VG UUID               qH5HhK-rJL0-j7ar-1Xhz-CN0x-nMVU-1j9MAk
  457.    
  458. [root@station26 disks]# lvextend -l +314 /dev/RAC12crhel6/root
  459.   Size of logical volume RAC12crhel6/root changed from 44.66 GiB (1429 extents) to 54.47 GiB (1743 extents).
  460.   Logical volume root successfully resized.
  461. [root@station26 disks]# resize2fs  /dev/RAC12crhel6/root
  462. resize2fs 1.43-WIP (20-Jun-2013)
  463. Filesystem at /dev/RAC12crhel6/root is mounted on /; on-line resizing required
  464. old_desc_blocks = 3, new_desc_blocks = 4
  465. The filesystem on /dev/RAC12crhel6/root is now 14278656 blocks long.

  466. [root@station26 disks]# df -h
  467. Filesystem            Size  Used Avail Use% Mounted on
  468. /dev/mapper/RAC12crhel6-root
  469.                        54G   41G   11G  79% /
  470. tmpfs                 9.5G  2.0G  7.6G  21% /dev/shm
  471. /dev/vda1             283M  114M  150M  44% /boot
  472. [root@station26 disks]#
复制代码
CDB和PDB的备份和恢复:
  1. [oracle@station26 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 12.1.0.2.0 Production on Thu Aug 10 20:50:29 2017

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

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> archive log list
  7. Database log mode               No Archive Mode
  8. Automatic archival               Disabled
  9. Archive destination               USE_DB_RECOVERY_FILE_DEST
  10. Oldest online log sequence     143
  11. Current log sequence               145
  12. SQL> shutdown immediate
  13. Database closed.
  14. Database dismounted.
  15. ORACLE instance shut down.
  16. SQL> startup mount
  17. ORACLE instance started.

  18. Total System Global Area 4060086272 bytes
  19. Fixed Size                    3718384 bytes
  20. Variable Size                  956302096 bytes
  21. Database Buffers         3087007744 bytes
  22. Redo Buffers                   13058048 bytes
  23. Database mounted.
  24. SQL> alter database archivelog;

  25. Database altered.

  26. SQL> alter database open
  27.   2  ;

  28. Database altered.

  29. SQL> alter system switch logfile;

  30. System altered.

  31. SQL> /

  32. System altered.

  33. SQL> set linesize 1000
  34. SQL> select  name from v$datafile;

  35. NAME
  36. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  37. /u01/app/oracle/oradata/cdb2/system01.dbf
  38. /u01/app/oracle/oradata/cdb2/sysaux01.dbf
  39. /u01/app/oracle/oradata/cdb2/undotbs01.dbf
  40. /u01/app/oracle/oradata/cdb2/pdbseed/system01.dbf
  41. /u01/app/oracle/oradata/cdb2/users01.dbf
  42. /u01/app/oracle/oradata/cdb2/pdbseed/sysaux01.dbf
  43. /u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf
  44. /u01/app/oracle/oradata/cdb2/pdb2_1/sysaux01.dbf
  45. /u01/app/oracle/oradata/cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_system_dqqy6v0z_.dbf
  46. /u01/app/oracle/oradata/cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_sysaux_dqqy6v12_.dbf
  47. /u01/app/oracle/oradata/cdb2/cdata_01.dbf

  48. NAME
  49. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  50. /u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf

  51. 12 rows selected.

  52. SQL> shutdown immediate
  53. Database closed.
  54. Database dismounted.
  55. ORACLE instance shut down.
  56. SQL> exit
  57. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  58. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  59. [oracle@station26 ~]$ cd /u01/app/oracle/
  60. [oracle@station26 oracle]$ ls
  61. admin  audit  cfgtoollogs  checkpoints  crsdata  diag  fast_recovery_area  log  oradata  product  station26
  62. [oracle@station26 oracle]$ cd oradata/
  63. [oracle@station26 oradata]$ ls
  64. cdb2  orcl  ORCL
  65. [oracle@station26 oradata]$ tar zcvf /home/oracle/Safe_Database_Files/cdb2/cdb2-under-u01_app_oracle_oradata.tgz  cdb2
  66. cdb2/
  67. cdb2/sysaux01.dbf
  68. cdb2/redo02.log
  69. cdb2/pdbseed/
  70. cdb2/pdbseed/sysaux01.dbf
  71. cdb2/pdbseed/system01.dbf
  72. cdb2/pdbseed/pdbseed_temp012017-07-27_09-39-39-PM.dbf
  73. cdb2/cdata_01.dbf
  74. cdb2/pdb2_2/
  75. cdb2/pdb2_2/CDB2/
  76. cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/
  77. cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/
  78. cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_system_dqqy6v0z_.dbf
  79. cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_temp_dqqy6v13_.dbf
  80. cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_sysaux_dqqy6v12_.dbf
  81. cdb2/users01.dbf
  82. cdb2/control01.ctl
  83. cdb2/pdb2_1/
  84. cdb2/pdb2_1/sysaux01.dbf
  85. cdb2/pdb2_1/temppdb2_01.dbf
  86. cdb2/pdb2_1/ldata_01.dbf
  87. cdb2/pdb2_1/my_temp_pdb2_01.dbf
  88. cdb2/pdb2_1/system01.dbf
  89. cdb2/pdb2_1/pdbseed_temp012017-07-27_09-39-39-PM.dbf
  90. cdb2/redo03.log
  91. cdb2/temproot_01.dbf
  92. cdb2/temp01.dbf
  93. cdb2/undotbs01.dbf
  94. cdb2/system01.dbf
  95. cdb2/redo01.log
  96. [oracle@station26 oradata]$ cd
  97. [oracle@station26 ~]$ ls
  98. afiedt.buf  ccb.ctl.ori              demo.zip   gl.sql    myfile          Public                    update2_t04209_uname.sql
  99. ap.sql      ccb.dis                  Desktop    icbc.ctl  oradiag_oracle  RMasmcmd.sh               update_t04209_uname.sql
  100. bank.sql    ccb.log                  dir1       icbc.dat  orcl2.xml       Safe_Database_Files       Videos
  101. ccb.bad     ccb.sql                  dir2       icbc.dis  parfile.ora     select2_t04209_uname.sql
  102. ccb.ctl     create_t04209_uname.sql  Documents  icbc.log  pdb1_1.xml      select_t04209_uname.sql
  103. ccb.CTL     demo                     Downloads  Music     Pictures        Templates
  104. [oracle@station26 ~]$ vim .bash_profile
  105. [oracle@station26 ~]$ . .bash_profile
  106. [oracle@station26 ~]$ sqlplus /nolog

  107. SQL*Plus: Release 12.1.0.2.0 Production on Thu Aug 10 21:01:54 2017

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

  109. SQL> conn / as sysdba
  110. Connected to an idle instance.
  111. SQL> startup
  112. ORACLE instance started.

  113. Total System Global Area 4060086272 bytes
  114. Fixed Size                    3718384 bytes
  115. Variable Size                  956302096 bytes
  116. Database Buffers         3087007744 bytes
  117. Redo Buffers                   13058048 bytes
  118. Database mounted.
  119. Database opened.
  120. SQL> select  con_id , name  ,  open_mode from v$pdbs;

  121.     CON_ID NAME                           OPEN_MODE
  122. ---------- ------------------------------ ----------
  123.          2 PDB$SEED                          READ ONLY
  124.          3 PDB2                           READ WRITE
  125.          4 PDB2_2                          READ WRITE

  126. SQL> exit
  127. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  128. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  129. [oracle@station26 ~]$ rman target  /

  130. Recovery Manager: Release 12.1.0.2.0 - Production on Thu Aug 10 21:04:15 2017

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

  132. connected to target database: CDB2 (DBID=697524940)

  133. RMAN> backup tag 'lab7-2' database including current controlfile plus archivelog delete all input ;

  134. RMAN-00571: ===========================================================
  135. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  136. RMAN-00571: ===========================================================
  137. RMAN-00558: error encountered while parsing input commands
  138. RMAN-01009: syntax error: found "including": expecting one of: "archivelog, auxiliary, backuppiece, backupset, backup, channel, controlfilecopy, copy, current, database, database root, datafilecopy, datafile, datapump, db_recovery_file_dest, delete, diskratio, filesperset, force, format, from, include, keep, maxsetsize, noexclude, nokeep, not, plus, pluggable, pool, recovery, reuse, root, section, skip readonly, skip, spfile, tablespace, tag, to, double-quoted-string, identifier, single-quoted-string, (, ;"
  139. RMAN-01007: at line 1 column 30 file: standard input

  140. RMAN> backup tag 'lab7-2' database include current controlfile plus archivelog delete all input ;


  141. Starting backup at 10-08-2017 09:05:26
  142. current log archived
  143. using target database control file instead of recovery catalog
  144. configuration for SBT_TAPE channel 2 is ignored
  145. allocated channel: ORA_SBT_TAPE_1
  146. channel ORA_SBT_TAPE_1: SID=368 device type=SBT_TAPE
  147. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  148. channel ORA_SBT_TAPE_1: starting archived log backup set
  149. channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
  150. input archived log thread=1 sequence=145 RECID=1 STAMP=951684762
  151. input archived log thread=1 sequence=146 RECID=2 STAMP=951684763
  152. input archived log thread=1 sequence=147 RECID=3 STAMP=951685527
  153. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:05:28
  154. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:05:53
  155. piece handle=01sbj4co_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  156. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
  157. ^C
  158. user interrupt received
  159. RMAN-00571: ===========================================================
  160. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  161. RMAN-00571: ===========================================================
  162. RMAN-03002: failure of backup plus archivelog command at 08/10/2017 21:05:54
  163. ORA-01013: user requested cancel of current operation

  164. RMAN> ^C
  165. user interrupt received
  166. ^C
  167. user interrupt received
  168. ^C
  169. user interrupt received


  170. RMAN>

  171. RMAN>

  172. RMAN>

  173. RMAN> show all;

  174. RMAN configuration parameters for database with db_unique_name CDB2 are:
  175. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
  176. CONFIGURE BACKUP OPTIMIZATION ON;
  177. CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
  178. CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
  179. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
  180. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
  181. CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  182. CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
  183. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  184. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  185. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  186. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  187. CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station26)';
  188. CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station26)';
  189. CONFIGURE MAXSETSIZE TO UNLIMITED; # default
  190. CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
  191. CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
  192. CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
  193. CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
  194. CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
  195. CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/snapcf_cdb2.f'; # default

  196. RMAN> CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 2 BACKUP TYPE TO BACKUPSET;

  197. new RMAN configuration parameters:
  198. CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  199. new RMAN configuration parameters are successfully stored
  200. PSDRPC returns significant error 1013.
  201. RMAN-00571: ===========================================================
  202. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  203. RMAN-00571: ===========================================================
  204. RMAN-03002: failure of configure command at 08/10/2017 21:06:17
  205. ORA-01013: user requested cancel of current operation

  206. RMAN> show all;

  207. RMAN configuration parameters for database with db_unique_name CDB2 are:
  208. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
  209. CONFIGURE BACKUP OPTIMIZATION ON;
  210. CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
  211. CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
  212. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
  213. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
  214. CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  215. CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  216. CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
  217. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  218. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  219. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  220. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  221. CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station26)';
  222. CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station26)';
  223. CONFIGURE MAXSETSIZE TO UNLIMITED; # default
  224. CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
  225. CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
  226. CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
  227. CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
  228. CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
  229. CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/snapcf_cdb2.f'; # default

  230. RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET;

  231. old RMAN configuration parameters:
  232. CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  233. new RMAN configuration parameters:
  234. CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET;
  235. new RMAN configuration parameters are successfully stored
  236. released channel: ORA_SBT_TAPE_1

  237. RMAN> exit


  238. Recovery Manager complete.
  239. [oracle@station26 ~]$ rman target  /

  240. Recovery Manager: Release 12.1.0.2.0 - Production on Thu Aug 10 21:07:03 2017

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

  242. connected to target database: CDB2 (DBID=697524940)

  243. RMAN> backup tag 'lab7-2' database include current controlfile plus archivelog delete all input ;


  244. Starting backup at 10-08-2017 09:07:06
  245. current log archived
  246. using target database control file instead of recovery catalog
  247. allocated channel: ORA_SBT_TAPE_1
  248. channel ORA_SBT_TAPE_1: SID=368 device type=SBT_TAPE
  249. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  250. allocated channel: ORA_SBT_TAPE_2
  251. channel ORA_SBT_TAPE_2: SID=128 device type=SBT_TAPE
  252. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  253. skipping archived logs of thread 1 from sequence 145 to 147; already backed up
  254. channel ORA_SBT_TAPE_1: starting archived log backup set
  255. channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
  256. input archived log thread=1 sequence=148 RECID=4 STAMP=951685626
  257. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:07:08
  258. channel ORA_SBT_TAPE_2: deleting archived log(s)
  259. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_08_10/o1_mf_1_145_drrort3o_.arc RECID=1 STAMP=951684762
  260. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_08_10/o1_mf_1_146_drrorvt4_.arc RECID=2 STAMP=951684763
  261. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_08_10/o1_mf_1_147_drrpjpwz_.arc RECID=3 STAMP=951685527
  262. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:07:34
  263. piece handle=02sbj4fs_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  264. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:26
  265. channel ORA_SBT_TAPE_1: deleting archived log(s)
  266. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_08_10/o1_mf_1_148_drrpmt9t_.arc RECID=4 STAMP=951685626
  267. Finished backup at 10-08-2017 09:07:34

  268. Starting backup at 10-08-2017 09:07:34
  269. using channel ORA_SBT_TAPE_1
  270. using channel ORA_SBT_TAPE_2
  271. channel ORA_SBT_TAPE_1: starting full datafile backup set
  272. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  273. input datafile file number=00003 name=/u01/app/oracle/oradata/cdb2/sysaux01.dbf
  274. input datafile file number=00004 name=/u01/app/oracle/oradata/cdb2/undotbs01.dbf
  275. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:07:35
  276. channel ORA_SBT_TAPE_2: starting full datafile backup set
  277. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  278. input datafile file number=00001 name=/u01/app/oracle/oradata/cdb2/system01.dbf
  279. input datafile file number=00028 name=/u01/app/oracle/oradata/cdb2/cdata_01.dbf
  280. input datafile file number=00006 name=/u01/app/oracle/oradata/cdb2/users01.dbf
  281. channel ORA_SBT_TAPE_2: starting piece 1 at 10-08-2017 09:07:35
  282. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:08:10
  283. piece handle=03sbj4gn_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  284. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:35
  285. channel ORA_SBT_TAPE_1: starting full datafile backup set
  286. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  287. input datafile file number=00011 name=/u01/app/oracle/oradata/cdb2/pdb2_1/sysaux01.dbf
  288. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:08:10
  289. channel ORA_SBT_TAPE_2: finished piece 1 at 10-08-2017 09:08:10
  290. piece handle=04sbj4gn_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  291. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:35
  292. channel ORA_SBT_TAPE_2: starting full datafile backup set
  293. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  294. input datafile file number=00015 name=/u01/app/oracle/oradata/cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_sysaux_dqqy6v12_.dbf
  295. channel ORA_SBT_TAPE_2: starting piece 1 at 10-08-2017 09:08:10
  296. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:08:35
  297. piece handle=05sbj4hq_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  298. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
  299. channel ORA_SBT_TAPE_1: starting full datafile backup set
  300. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  301. input datafile file number=00007 name=/u01/app/oracle/oradata/cdb2/pdbseed/sysaux01.dbf
  302. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:08:35
  303. channel ORA_SBT_TAPE_2: finished piece 1 at 10-08-2017 09:08:42
  304. piece handle=06sbj4hq_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  305. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:32
  306. channel ORA_SBT_TAPE_2: starting full datafile backup set
  307. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  308. input datafile file number=00010 name=/u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf
  309. input datafile file number=00029 name=/u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf
  310. channel ORA_SBT_TAPE_2: starting piece 1 at 10-08-2017 09:08:43
  311. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:09:08
  312. piece handle=07sbj4ij_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  313. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:33
  314. channel ORA_SBT_TAPE_1: starting full datafile backup set
  315. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  316. input datafile file number=00014 name=/u01/app/oracle/oradata/cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_system_dqqy6v0z_.dbf
  317. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:09:08
  318. channel ORA_SBT_TAPE_2: finished piece 1 at 10-08-2017 09:09:11
  319. piece handle=08sbj4ir_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  320. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:28
  321. channel ORA_SBT_TAPE_2: starting full datafile backup set
  322. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  323. input datafile file number=00005 name=/u01/app/oracle/oradata/cdb2/pdbseed/system01.dbf
  324. channel ORA_SBT_TAPE_2: starting piece 1 at 10-08-2017 09:09:11
  325. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:09:46
  326. piece handle=09sbj4jk_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  327. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:38
  328. channel ORA_SBT_TAPE_1: starting full datafile backup set
  329. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  330. including current control file in backup set
  331. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:09:48
  332. channel ORA_SBT_TAPE_2: finished piece 1 at 10-08-2017 09:09:55
  333. piece handle=0asbj4jn_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  334. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:44
  335. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:10:03
  336. piece handle=0bsbj4kr_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  337. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:15
  338. Finished backup at 10-08-2017 09:10:03

  339. Starting backup at 10-08-2017 09:10:03
  340. current log archived
  341. using channel ORA_SBT_TAPE_1
  342. using channel ORA_SBT_TAPE_2
  343. channel ORA_SBT_TAPE_1: starting archived log backup set
  344. channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
  345. input archived log thread=1 sequence=149 RECID=5 STAMP=951685803
  346. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:10:03
  347. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:10:28
  348. piece handle=0csbj4lb_1_1 tag=LAB7-2 comment=API Version 2.0,MMS Version 10.4.0.4
  349. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
  350. channel ORA_SBT_TAPE_1: deleting archived log(s)
  351. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_08_10/o1_mf_1_149_drrpscdv_.arc RECID=5 STAMP=951685803
  352. Finished backup at 10-08-2017 09:10:28

  353. Starting Control File and SPFILE Autobackup at 10-08-2017 09:10:29
  354. piece handle=c-697524940-20170810-00 comment=API Version 2.0,MMS Version 10.4.0.4
  355. Finished Control File and SPFILE Autobackup at 10-08-2017 09:11:04

  356. RMAN> list backup;


  357. List of Backup Sets
  358. ===================


  359. BS Key  Size       Device Type Elapsed Time Completion Time   
  360. ------- ---------- ----------- ------------ -------------------
  361. 1       11.25M     SBT_TAPE    00:00:08     10-08-2017 09:05:36
  362.         BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  363.         Handle: 01sbj4co_1_1   Media: station26-000001

  364.   List of Archived Logs in backup set 1
  365.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  366.   ---- ------- ---------- ------------------- ---------- ---------
  367.   1    145     6682101    10-08-2017 07:00:45 6690728    10-08-2017 08:52:42
  368.   1    146     6690728    10-08-2017 08:52:42 6690849    10-08-2017 08:52:43
  369.   1    147     6690849    10-08-2017 08:52:43 6693450    10-08-2017 09:05:26

  370. BS Key  Size       Device Type Elapsed Time Completion Time   
  371. ------- ---------- ----------- ------------ -------------------
  372. 2       64.00K     SBT_TAPE    00:00:16     10-08-2017 09:07:24
  373.         BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  374.         Handle: 02sbj4fs_1_1   Media: station26-000001

  375.   List of Archived Logs in backup set 2
  376.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  377.   ---- ------- ---------- ------------------- ---------- ---------
  378.   1    148     6693450    10-08-2017 09:05:26 6693546    10-08-2017 09:07:06

  379. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  380. ------- ---- -- ---------- ----------- ------------ -------------------
  381. 3       Full    802.06M    SBT_TAPE    00:00:21     10-08-2017 09:07:56
  382.         BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  383.         Handle: 03sbj4gn_1_1   Media: station26-000001
  384.   List of Datafiles in backup set 3
  385.   File LV Type Ckp SCN    Ckp Time            Name
  386.   ---- -- ---- ---------- ------------------- ----
  387.   3       Full 6693580    10-08-2017 09:07:35 /u01/app/oracle/oradata/cdb2/sysaux01.dbf
  388.   4       Full 6693580    10-08-2017 09:07:35 /u01/app/oracle/oradata/cdb2/undotbs01.dbf

  389. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  390. ------- ---- -- ---------- ----------- ------------ -------------------
  391. 4       Full    687.00M    SBT_TAPE    00:00:23     10-08-2017 09:07:58
  392.         BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  393.         Handle: 04sbj4gn_1_1   Media: station26-000002
  394.   List of Datafiles in backup set 4
  395.   File LV Type Ckp SCN    Ckp Time            Name
  396.   ---- -- ---- ---------- ------------------- ----
  397.   1       Full 6693581    10-08-2017 09:07:35 /u01/app/oracle/oradata/cdb2/system01.dbf
  398.   6       Full 6693581    10-08-2017 09:07:35 /u01/app/oracle/oradata/cdb2/users01.dbf
  399.   28      Full 6693581    10-08-2017 09:07:35 /u01/app/oracle/oradata/cdb2/cdata_01.dbf

  400. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  401. ------- ---- -- ---------- ----------- ------------ -------------------
  402. 5       Full    472.44M    SBT_TAPE    00:00:15     10-08-2017 09:08:25
  403.         BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  404.         Handle: 05sbj4hq_1_1   Media: station26-000001
  405.   List of Datafiles in backup set 5
  406.   Container ID: 3, PDB Name: PDB2
  407.   File LV Type Ckp SCN    Ckp Time            Name
  408.   ---- -- ---- ---------- ------------------- ----
  409.   11      Full 6693597    10-08-2017 09:08:10 /u01/app/oracle/oradata/cdb2/pdb2_1/sysaux01.dbf

  410. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  411. ------- ---- -- ---------- ----------- ------------ -------------------
  412. 6       Full    472.13M    SBT_TAPE    00:00:24     10-08-2017 09:08:34
  413.         BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  414.         Handle: 06sbj4hq_1_1   Media: station26-000002
  415.   List of Datafiles in backup set 6
  416.   Container ID: 4, PDB Name: PDB2_2
  417.   File LV Type Ckp SCN    Ckp Time            Name
  418.   ---- -- ---- ---------- ------------------- ----
  419.   15      Full 6693598    10-08-2017 09:08:10 /u01/app/oracle/oradata/cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_sysaux_dqqy6v12_.dbf

  420. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  421. ------- ---- -- ---------- ----------- ------------ -------------------
  422. 7       Full    455.88M    SBT_TAPE    00:00:15     10-08-2017 09:08:50
  423.         BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  424.         Handle: 07sbj4ij_1_1   Media: station26-000001
  425.   List of Datafiles in backup set 7
  426.   Container ID: 2, PDB Name: PDB$SEED
  427.   File LV Type Ckp SCN    Ckp Time            Name
  428.   ---- -- ---- ---------- ------------------- ----
  429.   7       Full 1748058    27-07-2017 09:53:17 /u01/app/oracle/oradata/cdb2/pdbseed/sysaux01.dbf

  430. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  431. ------- ---- -- ---------- ----------- ------------ -------------------
  432. 8       Full    210.56M    SBT_TAPE    00:00:19     10-08-2017 09:09:02
  433.         BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  434.         Handle: 08sbj4ir_1_1   Media: station26-000002
  435.   List of Datafiles in backup set 8
  436.   Container ID: 3, PDB Name: PDB2
  437.   File LV Type Ckp SCN    Ckp Time            Name
  438.   ---- -- ---- ---------- ------------------- ----
  439.   10      Full 6693613    10-08-2017 09:08:43 /u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf
  440.   29      Full 6693613    10-08-2017 09:08:43 /u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf

  441. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  442. ------- ---- -- ---------- ----------- ------------ -------------------
  443. 9       Full    209.56M    SBT_TAPE    00:00:26     10-08-2017 09:09:34
  444.         BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  445.         Handle: 09sbj4jk_1_1   Media: station26-000001,station26-000003
  446.   List of Datafiles in backup set 9
  447.   Container ID: 4, PDB Name: PDB2_2
  448.   File LV Type Ckp SCN    Ckp Time            Name
  449.   ---- -- ---- ---------- ------------------- ----
  450.   14      Full 6693632    10-08-2017 09:09:08 /u01/app/oracle/oradata/cdb2/pdb2_2/CDB2/556CA1053FA30662E0531A00A8C08765/datafile/o1_mf_system_dqqy6v0z_.dbf

  451. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  452. ------- ---- -- ---------- ----------- ------------ -------------------
  453. 10      Full    204.75M    SBT_TAPE    00:00:35     10-08-2017 09:09:46
  454.         BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  455.         Handle: 0asbj4jn_1_1   Media: station26-000002,station26-000004
  456.   List of Datafiles in backup set 10
  457.   Container ID: 2, PDB Name: PDB$SEED
  458.   File LV Type Ckp SCN    Ckp Time            Name
  459.   ---- -- ---- ---------- ------------------- ----
  460.   5       Full 1748058    27-07-2017 09:53:17 /u01/app/oracle/oradata/cdb2/pdbseed/system01.dbf

  461. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  462. ------- ---- -- ---------- ----------- ------------ -------------------
  463. 11      Full    17.19M     SBT_TAPE    00:00:08     10-08-2017 09:09:55
  464.         BP Key: 11   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  465.         Handle: 0bsbj4kr_1_1   Media: station26-000003
  466.   Control File Included: Ckp SCN: 6693652      Ckp time: 10-08-2017 09:09:47

  467. BS Key  Size       Device Type Elapsed Time Completion Time   
  468. ------- ---------- ----------- ------------ -------------------
  469. 12      64.00K     SBT_TAPE    00:00:16     10-08-2017 09:10:19
  470.         BP Key: 12   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  471.         Handle: 0csbj4lb_1_1   Media: station26-000003

  472.   List of Archived Logs in backup set 12
  473.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  474.   ---- ------- ---------- ------------------- ---------- ---------
  475.   1    149     6693546    10-08-2017 09:07:06 6693680    10-08-2017 09:10:03

  476. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  477. ------- ---- -- ---------- ----------- ------------ -------------------
  478. 13      Full    17.25M     SBT_TAPE    00:00:16     10-08-2017 09:10:45
  479.         BP Key: 13   Status: AVAILABLE  Compressed: NO  Tag: TAG20170810T211029
  480.         Handle: c-697524940-20170810-00   Media: station26-000003
  481.   SPFILE Included: Modification time: 10-08-2017 09:03:02
  482.   SPFILE db_unique_name: CDB2
  483.   Control File Included: Ckp SCN: 6693701      Ckp time: 10-08-2017 09:10:29

  484. RMAN> list copy;

  485. specification does not match any datafile copy in the repository
  486. specification does not match any control file copy in the repository
  487. specification does not match any archived log in the repository

  488. RMAN> exit


  489. Recovery Manager complete.
  490. [oracle@station26 ~]$ rman target  /

  491. Recovery Manager: Release 12.1.0.2.0 - Production on Thu Aug 10 21:14:42 2017

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

  493. connected to target database: CDB2 (DBID=697524940)

  494. RMAN> backup tag 'lab7-3' pluggable database pdb2 ;

  495. Starting backup at 10-08-2017 09:15:26
  496. using target database control file instead of recovery catalog
  497. allocated channel: ORA_SBT_TAPE_1
  498. channel ORA_SBT_TAPE_1: SID=368 device type=SBT_TAPE
  499. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  500. allocated channel: ORA_SBT_TAPE_2
  501. channel ORA_SBT_TAPE_2: SID=419 device type=SBT_TAPE
  502. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  503. channel ORA_SBT_TAPE_1: starting full datafile backup set
  504. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  505. input datafile file number=00011 name=/u01/app/oracle/oradata/cdb2/pdb2_1/sysaux01.dbf
  506. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:15:29
  507. channel ORA_SBT_TAPE_2: starting full datafile backup set
  508. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  509. input datafile file number=00010 name=/u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf
  510. input datafile file number=00029 name=/u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf
  511. channel ORA_SBT_TAPE_2: starting piece 1 at 10-08-2017 09:15:29
  512. channel ORA_SBT_TAPE_2: finished piece 1 at 10-08-2017 09:16:05
  513. piece handle=0fsbj4vh_1_1 tag=LAB7-3 comment=API Version 2.0,MMS Version 10.4.0.4
  514. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:36
  515. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:16:15
  516. piece handle=0esbj4vh_1_1 tag=LAB7-3 comment=API Version 2.0,MMS Version 10.4.0.4
  517. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:46
  518. Finished backup at 10-08-2017 09:16:15

  519. Starting Control File and SPFILE Autobackup at 10-08-2017 09:16:15
  520. piece handle=c-697524940-20170810-01 comment=API Version 2.0,MMS Version 10.4.0.4
  521. Finished Control File and SPFILE Autobackup at 10-08-2017 09:16:40

  522. RMAN> !df -h

  523. RMAN-00571: ===========================================================
  524. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  525. RMAN-00571: ===========================================================
  526. RMAN-00558: error encountered while parsing input commands
  527. RMAN-01006: error signaled during parse
  528. RMAN-02001: unrecognized punctuation symbol "!"

  529. RMAN> exit


  530. Recovery Manager complete.
  531. [oracle@station26 ~]$ df -h
  532. Filesystem            Size  Used Avail Use% Mounted on
  533. /dev/mapper/RAC12crhel6-root
  534.                        54G   43G  8.6G  84% /
  535. tmpfs                 9.5G  2.0G  7.6G  21% /dev/shm
  536. /dev/vda1             283M  114M  150M  44% /boot
  537. [oracle@station26 ~]$ rman target  /

  538. Recovery Manager: Release 12.1.0.2.0 - Production on Thu Aug 10 21:17:45 2017

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

  540. connected to target database: CDB2 (DBID=697524940)

  541. RMAN> exit


  542. Recovery Manager complete.
  543. [oracle@station26 ~]$ . oraenv
  544. ORACLE_SID = [cdb2] ? +ASM
  545. The Oracle base remains unchanged with value /u01/app/oracle
  546. [oracle@station26 ~]$ asmcmd
  547. ASMCMD> ls
  548. DATA/
  549. ASMCMD> cd data
  550. ASMCMD> ls
  551. ASM/
  552. orapwasm
  553. ASMCMD> exit
  554. [oracle@station26 ~]$ . oraenv
  555. ORACLE_SID = [+ASM] ? cdb2
  556. The Oracle base remains unchanged with value /u01/app/oracle
  557. [oracle@station26 ~]$ rman target  /

  558. Recovery Manager: Release 12.1.0.2.0 - Production on Thu Aug 10 21:18:21 2017

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

  560. connected to target database: CDB2 (DBID=697524940)

  561. RMAN> run {
  562. 2> allocate channel c1 device type disk format '+DATA' ;
  563. 3> backup tablespace sysaux;
  564. 4> }

  565. using target database control file instead of recovery catalog
  566. allocated channel: c1
  567. channel c1: SID=182 device type=DISK

  568. Starting backup at 10-08-2017 09:18:53
  569. channel c1: starting full datafile backup set
  570. channel c1: specifying datafile(s) in backup set
  571. input datafile file number=00003 name=/u01/app/oracle/oradata/cdb2/sysaux01.dbf
  572. channel c1: starting piece 1 at 10-08-2017 09:18:53
  573. channel c1: finished piece 1 at 10-08-2017 09:19:28
  574. piece handle=+DATA/CDB2/BACKUPSET/2017_08_10/nnndf0_tag20170810t211853_0.276.951686337 tag=TAG20170810T211853 comment=NONE
  575. channel c1: backup set complete, elapsed time: 00:00:35
  576. Finished backup at 10-08-2017 09:19:28

  577. Starting Control File and SPFILE Autobackup at 10-08-2017 09:19:28
  578. piece handle=/u01/app/oracle/fast_recovery_area/CDB2/autobackup/2017_08_10/o1_mf_s_951686368_drrqc1ns_.bkp comment=NONE
  579. Finished Control File and SPFILE Autobackup at 10-08-2017 09:19:31
  580. released channel: c1

  581. RMAN> run {
  582. 2> allocate channel c1 device type disk format '+DATA' ;
  583. 3> backup tablespace pdb2:sysaux;
  584. 4> }

  585. allocated channel: c1
  586. channel c1: SID=182 device type=DISK

  587. Starting backup at 10-08-2017 09:19:56
  588. channel c1: starting full datafile backup set
  589. channel c1: specifying datafile(s) in backup set
  590. input datafile file number=00011 name=/u01/app/oracle/oradata/cdb2/pdb2_1/sysaux01.dbf
  591. channel c1: starting piece 1 at 10-08-2017 09:19:57
  592. channel c1: finished piece 1 at 10-08-2017 09:20:22
  593. piece handle=+DATA/CDB2/556CA1053FA20662E0531A00A8C08765/BACKUPSET/2017_08_10/nnndf0_tag20170810t211956_0.275.951686397 tag=TAG20170810T211956 comment=NONE
  594. channel c1: backup set complete, elapsed time: 00:00:25
  595. Finished backup at 10-08-2017 09:20:22

  596. Starting Control File and SPFILE Autobackup at 10-08-2017 09:20:22
  597. piece handle=/u01/app/oracle/fast_recovery_area/CDB2/autobackup/2017_08_10/o1_mf_s_951686422_drrqdq0o_.bkp comment=NONE
  598. Finished Control File and SPFILE Autobackup at 10-08-2017 09:20:25
  599. released channel: c1

  600. RMAN> backup tag 'lab7-3-ldata'  tablespace pdb2:ldata ;

  601. Starting backup at 10-08-2017 09:20:45
  602. allocated channel: ORA_SBT_TAPE_1
  603. channel ORA_SBT_TAPE_1: SID=182 device type=SBT_TAPE
  604. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  605. allocated channel: ORA_SBT_TAPE_2
  606. channel ORA_SBT_TAPE_2: SID=421 device type=SBT_TAPE
  607. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  608. channel ORA_SBT_TAPE_1: starting full datafile backup set
  609. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  610. input datafile file number=00029 name=/u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf
  611. channel ORA_SBT_TAPE_1: starting piece 1 at 10-08-2017 09:20:46
  612. channel ORA_SBT_TAPE_1: finished piece 1 at 10-08-2017 09:21:11
  613. piece handle=0lsbj59e_1_1 tag=LAB7-3-LDATA comment=API Version 2.0,MMS Version 10.4.0.4
  614. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
  615. Finished backup at 10-08-2017 09:21:11

  616. Starting Control File and SPFILE Autobackup at 10-08-2017 09:21:12
  617. piece handle=c-697524940-20170810-04 comment=API Version 2.0,MMS Version 10.4.0.4
  618. Finished Control File and SPFILE Autobackup at 10-08-2017 09:21:37

  619. RMAN> exit


  620. Recovery Manager complete.
  621. [oracle@station26 ~]$ sqlplus /nolog

  622. SQL*Plus: Release 12.1.0.2.0 Production on Thu Aug 10 21:25:12 2017

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

  624. SQL> conn / as sysdba
  625. Connected.
  626. SQL> select  con_id, name , open_mode from v$pdbs;

  627.     CON_ID NAME                           OPEN_MODE
  628. ---------- ------------------------------ ----------
  629.          2 PDB$SEED                          READ ONLY
  630.          3 PDB2                           READ WRITE
  631.          4 PDB2_2                          READ WRITE

  632. SQL> select  con_id, name , open_mode from v$pdbs;

  633.     CON_ID NAME                           OPEN_MODE
  634. ---------- ------------------------------ ----------
  635.          2 PDB$SEED                          READ ONLY
  636.          3 PDB2                           READ WRITE
  637.          4 PDB2_2                          READ WRITE

  638. SQL> conn sys/oracle_4U@pdb2 as sysdba
  639. Connected.
  640. SQL> alter system checkpoint;

  641. System altered.

  642. SQL> alter system switch logfile;
  643. alter system switch logfile
  644. *
  645. ERROR at line 1:
  646. ORA-65040: operation not allowed from within a pluggable database


  647. SQL> create table t1( a number ) tablespace system ;
  648. create table t1( a number ) tablespace system
  649. *
  650. ERROR at line 1:
  651. ORA-00604: error occurred at recursive SQL level 1
  652. ORA-01116: error in opening database file 10
  653. ORA-01110: data file 10: '/u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf'
  654. ORA-27041: unable to open file
  655. Linux-x86_64 Error: 2: No such file or directory
  656. Additional information: 3


  657. SQL> alter puggable database close ;
  658. alter puggable database close
  659.       *
  660. ERROR at line 1:
  661. ORA-00940: invalid ALTER command


  662. SQL> alter pluggable database close ;

  663. Pluggable database altered.

  664. SQL> select  open_mode from v$database;

  665. OPEN_MODE
  666. --------------------
  667. MOUNTED

  668. SQL> exit
  669. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  670. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  671. and Real Application Testing options
  672. [oracle@station26 ~]$ rman target /

  673. Recovery Manager: Release 12.1.0.2.0 - Production on Thu Aug 10 21:28:54 2017

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

  675. connected to target database: CDB2 (DBID=697524940)

  676. RMAN> list backup of tablespace pdb2:system;

  677. using target database control file instead of recovery catalog

  678. List of Backup Sets
  679. ===================


  680. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  681. ------- ---- -- ---------- ----------- ------------ -------------------
  682. 8       Full    210.56M    SBT_TAPE    00:00:19     10-08-2017 09:09:02
  683.         BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: LAB7-2
  684.         Handle: 08sbj4ir_1_1   Media: station26-000002
  685.   List of Datafiles in backup set 8
  686.   File LV Type Ckp SCN    Ckp Time            Name
  687.   ---- -- ---- ---------- ------------------- ----
  688.   10      Full 6693613    10-08-2017 09:08:43 /u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf

  689. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  690. ------- ---- -- ---------- ----------- ------------ -------------------
  691. 14      Full    210.56M    SBT_TAPE    00:00:20     10-08-2017 09:15:49
  692.         BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: LAB7-3
  693.         Handle: 0fsbj4vh_1_1   Media: station26-000003
  694.   List of Datafiles in backup set 14
  695.   File LV Type Ckp SCN    Ckp Time            Name
  696.   ---- -- ---- ---------- ------------------- ----
  697.   10      Full 6694330    10-08-2017 09:15:30 /u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf

  698. RMAN> restore tablespace pdb2:system;

  699. Starting restore at 10-08-2017 09:29:29
  700. allocated channel: ORA_DISK_1
  701. channel ORA_DISK_1: SID=361 device type=DISK
  702. allocated channel: ORA_DISK_2
  703. channel ORA_DISK_2: SID=420 device type=DISK
  704. allocated channel: ORA_DISK_3
  705. channel ORA_DISK_3: SID=366 device type=DISK
  706. allocated channel: ORA_DISK_4
  707. channel ORA_DISK_4: SID=67 device type=DISK
  708. allocated channel: ORA_DISK_5
  709. channel ORA_DISK_5: SID=310 device type=DISK
  710. allocated channel: ORA_DISK_6
  711. channel ORA_DISK_6: SID=414 device type=DISK
  712. allocated channel: ORA_DISK_7
  713. channel ORA_DISK_7: SID=10 device type=DISK
  714. allocated channel: ORA_DISK_8
  715. channel ORA_DISK_8: SID=71 device type=DISK
  716. allocated channel: ORA_SBT_TAPE_1
  717. channel ORA_SBT_TAPE_1: SID=127 device type=SBT_TAPE
  718. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  719. allocated channel: ORA_SBT_TAPE_2
  720. channel ORA_SBT_TAPE_2: SID=182 device type=SBT_TAPE
  721. channel ORA_SBT_TAPE_2: Oracle Secure Backup

  722. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  723. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  724. channel ORA_SBT_TAPE_1: restoring datafile 00010 to /u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf
  725. channel ORA_SBT_TAPE_1: reading from backup piece 0fsbj4vh_1_1
  726. channel ORA_SBT_TAPE_1: piece handle=0fsbj4vh_1_1 tag=LAB7-3
  727. channel ORA_SBT_TAPE_1: restored backup piece 1
  728. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:35
  729. Finished restore at 10-08-2017 09:30:11

  730. RMAN> recover tablespace pdb2:system ;

  731. Starting recover at 10-08-2017 09:31:05
  732. using channel ORA_DISK_1
  733. using channel ORA_DISK_2
  734. using channel ORA_DISK_3
  735. using channel ORA_DISK_4
  736. using channel ORA_DISK_5
  737. using channel ORA_DISK_6
  738. using channel ORA_DISK_7
  739. using channel ORA_DISK_8
  740. using channel ORA_SBT_TAPE_1
  741. using channel ORA_SBT_TAPE_2

  742. starting media recovery
  743. media recovery complete, elapsed time: 00:00:00

  744. Finished recover at 10-08-2017 09:31:06

  745. RMAN> alter pluggables database pdb2 open ;

  746. RMAN-00571: ===========================================================
  747. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  748. RMAN-00571: ===========================================================
  749. RMAN-03002: failure of sql statement command at 08/10/2017 21:31:26
  750. ORA-00940: invalid ALTER command

  751. RMAN> recover tablespace pdb2:ldata;

  752. Starting recover at 10-08-2017 09:32:15
  753. using channel ORA_DISK_1
  754. using channel ORA_DISK_2
  755. using channel ORA_DISK_3
  756. using channel ORA_DISK_4
  757. using channel ORA_DISK_5
  758. using channel ORA_DISK_6
  759. using channel ORA_DISK_7
  760. using channel ORA_DISK_8
  761. using channel ORA_SBT_TAPE_1
  762. using channel ORA_SBT_TAPE_2

  763. starting media recovery
  764. media recovery complete, elapsed time: 00:00:00

  765. Finished recover at 10-08-2017 09:32:16

  766. RMAN>  recover pluggable database pdb2 ;

  767. Starting recover at 10-08-2017 09:32:40
  768. using channel ORA_DISK_1
  769. using channel ORA_DISK_2
  770. using channel ORA_DISK_3
  771. using channel ORA_DISK_4
  772. using channel ORA_DISK_5
  773. using channel ORA_DISK_6
  774. using channel ORA_DISK_7
  775. using channel ORA_DISK_8
  776. using channel ORA_SBT_TAPE_1
  777. using channel ORA_SBT_TAPE_2

  778. starting media recovery
  779. media recovery complete, elapsed time: 00:00:00

  780. Finished recover at 10-08-2017 09:32:41

  781. RMAN>
复制代码




回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-19 17:13 , Processed in 0.050632 second(s), 27 queries .

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