kanciastopantalones

bd lab 4

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