Advertisement
kanciastopantalones

NASZE

Nov 4th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.52 KB | None | 0 0
  1. Czesc I
  2. 1. rman target sustem/manager@orcl
  3.  
  4. 2.
  5. CONFIGURE DEFAULT DEVICE TYPE TO DISK;
  6. CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
  7. CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
  8. CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘c:\kopie_RMAN\ora_df%t_s%s_s%p';
  9. CONFIGURE CONTROLFILE AUTOBACKUP ON;
  10. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘c:\kopie_RMAN\ora_cf%F';
  11. CONFIGURE BACKUP OPTIMIZATION ON;
  12.  
  13. 3.
  14. RMAN configuration parameters for database with db_unique_name ORCL are:
  15. CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
  16. CONFIGURE BACKUP OPTIMIZATION ON;
  17. CONFIGURE DEFAULT DEVICE TYPE TO DISK;
  18. CONFIGURE CONTROLFILE AUTOBACKUP ON;
  19. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "c:\kopie_RMAN\o
  20. ra_cf%F";
  21. CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  22. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  23. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  24. CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT "c:\kopie_RMAN\ora_df%t_s%s_s%p";
  25. CONFIGURE MAXSETSIZE TO UNLIMITED; # default
  26. CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
  27. CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
  28. CONFIGURE COMPRESSION ALGORITHM 'BZIP2'; # default
  29. CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
  30. CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\APP\PRODUCT\11.1.0\DB_1\DATABASE\SNCF
  31. ORCL.ORA'; # default
  32.  
  33.  
  34. CZESC II
  35.  
  36. 1. system/manager@orcl
  37. 2. SQL> select log_mode from v$database;
  38. LOG_MODE
  39. ------------
  40. NOARCHIVELOG
  41.  
  42. 3. SHUTDOWN IMMEDIATE
  43. 4. SQL> startup mount;
  44. ORACLE instance started.
  45.  
  46. Total System Global Area 535662592 bytes
  47. Fixed Size 1334380 bytes
  48. Variable Size 201327626 bytes
  49. Database Buffers 327155884 bytes
  50. Redo Buffers 5844992 bytes
  51. Database mounted.
  52. 5. rman target sys/manager@targetdb
  53. 6 RMAN> backup database;
  54.  
  55. Starting backup at 04-NOV-16
  56. using channel ORA_DISK_1
  57. using channel ORA_DISK_2
  58. channel ORA_DISK_1: starting full datafile backup set
  59. channel ORA_DISK_1: specifying datafile(s) in backup set
  60. input datafile file number=00001 name=C:\APP\ORADATA\ORCL\SYSTEM01.DBF
  61. input datafile file number=00003 name=C:\APP\ORADATA\ORCL\UNDOTBS01.DBF
  62. channel ORA_DISK_1: starting piece 1 at 04-NOV-16
  63. channel ORA_DISK_2: starting full datafile backup set
  64. channel ORA_DISK_2: specifying datafile(s) in backup set
  65. input datafile file number=00002 name=C:\APP\ORADATA\ORCL\SYSAUX01.DBF
  66. input datafile file number=00005 name=C:\APP\ORADATA\ORCL\EXAMPLE01.DBF
  67. input datafile file number=00004 name=C:\APP\ORADATA\ORCL\USERS01.DBF
  68. channel ORA_DISK_2: starting piece 1 at 04-NOV-16
  69. channel ORA_DISK_1: finished piece 1 at 04-NOV-16
  70. piece handle=C:\KOPIE_RMAN\ORA_DF865814791_S3_S1 tag=TAG20161104T000630 comment=
  71. NONE
  72. channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
  73. channel ORA_DISK_2: finished piece 1 at 04-NOV-16
  74. piece handle=C:\KOPIE_RMAN\ORA_DF865814795_S4_S1 tag=TAG20161104T000630 comment=
  75. NONE
  76. channel ORA_DISK_2: backup set complete, elapsed time: 00:00:38
  77. Finished backup at 04-NOV-16
  78.  
  79. Starting Control File and SPFILE Autobackup at 04-NOV-16
  80. piece handle=C:\KOPIE_RMAN\ORA_CFC-1296006456-20161104-00 comment=NONE
  81. Finished Control File and SPFILE Autobackup at 04-NOV-16
  82.  
  83. 7. Kopia bazy: C:\KOPIE_RMAN
  84.  
  85. 9. RMAN> startup
  86.  
  87. database is already started
  88. database opened
  89.  
  90. 12. SQL> CREATE USER student IDENTIFIED BY student;
  91.  
  92. User created.
  93.  
  94. SQL> GRANT DBA to Student
  95. 2 ;
  96.  
  97. Grant succeeded.
  98.  
  99. SQL> select tablespace_name, table_name from tabs;
  100.  
  101. TABLESPACE_NAME TABLE_NAME
  102. ------------------------------ ------------------------------
  103. SYSTEM SYS_IOT_OVER_11732
  104. SYSAUX SYS$SERVICE_METRICS_TAB
  105. SYSAUX AQ$_SYS$SERVICE_METRICS_TAB_S
  106. SYSAUX SYS_IOT_OVER_11848
  107. SYSTEM KSIZAKA
  108. ATEMPTAB$
  109. SQLLOG$
  110. SQLOBJ$
  111. SQLOBJ$DATA
  112. MAP_OBJECT
  113. CLUSTER_DATABASES
  114. 13. SQL> insert into KSIAZKA values(1,'Jeden',111);
  115.  
  116. 1 row created.
  117.  
  118. SQL> insert into KSIAZKA values(2,'Dwa',222);
  119.  
  120. 1 row created.
  121.  
  122. SQL> insert into KSIAZKA values(3,'Trzy',333);
  123.  
  124. 1 row created.
  125.  
  126. SQL> COMMIT
  127.  
  128. Commit complete.
  129.  
  130. 14. SQL> ALTER SYSTEM SWITCH LOGFILE;
  131.  
  132. System altered.
  133.  
  134. SQL> ALTER SYSTEM SWITCH LOGFILE;
  135.  
  136. System altered.
  137.  
  138. SQL> ALTER SYSTEM SWITCH LOGFILE;
  139.  
  140. System altered.
  141.  
  142. SQL> ALTER SYSTEM SWITCH LOGFILE;
  143.  
  144. System altered.
  145.  
  146. 15. SQL> SHUTDOWN IMMEDIATE;
  147. Database closed.
  148. Database dismounted.
  149. ORACLE instance shut down.
  150.  
  151. 16. Usunieto:
  152. C:\app\oradata\orcl\USERS01.DBF
  153.  
  154.  
  155. 17. SQL> startup;
  156. ORACLE instance started.
  157.  
  158. Total System Global Area 535662592 bytes
  159. Fixed Size 1334380 bytes
  160. Variable Size 201327626 bytes
  161. Database Buffers 327155884 bytes
  162. Redo Buffers 5844992 bytes
  163. Database mounted.
  164. ORA-01113: file 1 needs media recovery
  165. ORA-01110: data file 1: 'C:\APP\ORADATA\ORCL\SYSTEM01.DBF'
  166.  
  167. Wykryto brakujacy plik
  168.  
  169. SQL> startup;
  170. ORACLE instance started.
  171.  
  172. Total System Global Area 535662592 bytes
  173. Fixed Size 1334380 bytes
  174. Variable Size 201327626 bytes
  175. Database Buffers 327155884 bytes
  176. Redo Buffers 5844992 bytes
  177. Database mounted.
  178. ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
  179. ORA-01110: data file 4: 'C:\APP\ORADATA\ORCL\USERS01.DBF'
  180.  
  181. 18. rman target sys/manager@orcl
  182.  
  183. 19. RMAN> RESTORE TABLESPACE USERS;
  184.  
  185. Starting restore at 04-NOV-16
  186. using target database control file instead of recovery catalog
  187. allocated channel: ORA_DISK_1
  188. channel ORA_DISK_1: SID=161 device type=DISK
  189. allocated channel: ORA_DISK_2
  190. channel ORA_DISK_2: SID=151 device type=DISK
  191.  
  192. channel ORA_DISK_1: starting datafile backup set restore
  193. channel ORA_DISK_1: specifying datafile(s) to restore from backup set
  194. channel ORA_DISK_1: restoring datafile 00004 to C:\APP\ORADATA\ORCL\USERS01.DBF
  195. channel ORA_DISK_1: reading from backup piece C:\KOPIE_RMAN\ORA_DF865814795_S4_S
  196. 1
  197. channel ORA_DISK_1: piece handle=C:\KOPIE_RMAN\ORA_DF865814795_S4_S1 tag=TAG20161104T000630
  198. channel ORA_DISK_1: restored backup piece 1
  199. channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
  200. Finished restore at 04-NOV-16
  201.  
  202. 20. SQL> SHUTDOWN IMMEDIATE;
  203. ORA-01109: database not open
  204.  
  205.  
  206. Database dismounted.
  207. ORACLE instance shut down.
  208. SQL> startup;
  209. ORACLE instance started.
  210.  
  211. Total System Global Area 535662592 bytes
  212. Fixed Size 1334380 bytes
  213. Variable Size 184550292 bytes
  214. Database Buffers 343932928 bytes
  215. Redo Buffers 5844992 bytes
  216. Database mounted.
  217. ORA-01113: file 1 needs media recovery
  218. ORA-01110: data file 1: 'C:\APP\ORADATA\ORCL\SYSTEM01.DBF'
  219.  
  220.  
  221. 21. System wymaga pliku
  222. 'C:\APP\ORADATA\ORCL\SYSTEM01.DBF'
  223.  
  224. CZESC IV
  225.  
  226. 2. SQL> select log_mode from v$database;
  227. SQL> archive log
  228.  
  229. LOG_MODE
  230. ------------
  231. NOARCHIVELOG
  232.  
  233.  
  234. 3. SQL> SHUTDOWN IMMEDIATE;
  235. ORA-01109: database not open
  236.  
  237.  
  238. Database dismounted.
  239. ORACLE instance shut down.
  240.  
  241. 4. SQL> startup mount;
  242. ORACLE instance started.
  243.  
  244. Total System Global Area 535662592 bytes
  245. Fixed Size 1334380 bytes
  246. Variable Size 184550292 bytes
  247. Database Buffers 343932928 bytes
  248. Redo Buffers 5844992 bytes
  249. Database mounted.
  250.  
  251. SQL> alter database archivelog;
  252.  
  253. Database altered.
  254. SQL> alter database open;
  255.  
  256. Database altered.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement