Advertisement
Guest User

Untitled

a guest
Nov 6th, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.95 KB | None | 0 0
  1.  
  2. Connected to:
  3. Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  4. With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
  5. and Unified Auditing options
  6.  
  7. SQL> select log_mode from v$database;
  8.  
  9. LOG_MODE
  10. ------------
  11. ARCHIVELOG
  12.  
  13. SQL> alter database open;
  14. alter database open
  15. *
  16. ERROR at line 1:
  17. ORA-01531: a database already open by the instance
  18.  
  19.  
  20. SQL> select supplemental_log_data_min from v$database;
  21.  
  22. SUPPLEME
  23. --------
  24. YES
  25.  
  26. SQL> show parameter utl_file_dir
  27.  
  28. NAME TYPE VALUE
  29. ------------------------------------ ----------- ------------------------------
  30. utl_file_dir string
  31. SQL> Create Pfile from SPfile;
  32.  
  33. File created.
  34.  
  35. SQL> shutdown immediate;
  36. Database closed.
  37. Database dismounted.
  38. ORACLE instance shut down.
  39. SQL> select name, value from v$parameter where name like 'utl_file_dir';
  40. select name, value from v$parameter where name like 'utl_file_dir'
  41. *
  42. ERROR at line 1:
  43. ORA-01034: ORACLE not available
  44. Process ID: 0
  45. Session ID: 0 Serial number: 0
  46.  
  47.  
  48. ERROR:
  49. ORA-01034: ORACLE not available
  50. Process ID: 0
  51. Session ID: 0 Serial number: 0
  52.  
  53.  
  54. SQL> startup mount
  55. ORACLE instance started.
  56.  
  57. Total System Global Area 5117050880 bytes
  58. Fixed Size 3056232 bytes
  59. Variable Size 1040190872 bytes
  60. Database Buffers 4060086272 bytes
  61. Redo Buffers 13717504 bytes
  62. Database mounted.
  63. SQL> select name, value from v$parameter where name like 'utl_file_dir';
  64.  
  65. NAME
  66. --------------------------------------------------
  67. VALUE
  68. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  69. utl_file_dir
  70.  
  71.  
  72.  
  73. SQL> shutdown immediate;
  74. ORA-01109: database not open
  75.  
  76.  
  77. Database dismounted.
  78. ORACLE instance shut down.
  79. SQL> startup pfile='C:\app\Oracle12\product\12.1.0\dbhome_1\database\INItorcl.ORA';
  80. ORACLE instance started.
  81.  
  82. Total System Global Area 5117050880 bytes
  83. Fixed Size 3056232 bytes
  84. Variable Size 1040190872 bytes
  85. Database Buffers 4060086272 bytes
  86. Redo Buffers 13717504 bytes
  87. Database mounted.
  88. Database opened.
  89. SQL> show parameter utl_file_dir
  90.  
  91. NAME TYPE VALUE
  92. ------------------------------------ ----------- ------------------------------
  93. utl_file_dir string C:\app\backup\logmnr
  94. SQL> select supplemental_log_data_min from v$database;
  95.  
  96. SUPPLEME
  97. --------
  98. YES
  99.  
  100. SQL> show parameter db_recovery_file_dest;
  101.  
  102. NAME TYPE VALUE
  103. ------------------------------------ ----------- ------------------------------
  104. db_recovery_file_dest string
  105. db_recovery_file_dest_size big integer 0
  106. SQL> Alter system set db_recovery_file_dest_size=20G;
  107.  
  108. System altered.
  109.  
  110. SQL> Alter system set db_recovery_file_dest='C:\app\backup';
  111.  
  112. System altered.
  113.  
  114. SQL> begin
  115. 2 dbms_logmnr_d.build(
  116. 3 dictionary_filename => 'dictionary.ora',
  117. 4 dictionary_location => 'C:\app\backup\logmnr',
  118. 5 options => dbms_logmnr_d.store_in_flat_file);
  119. 6 end;
  120. 7 /
  121.  
  122. PL/SQL procedure successfully completed.
  123.  
  124. SQL> conn test/test@pdborcl
  125. ERROR:
  126. ORA-01033: ORACLE initialization or shutdown in progress
  127. Process ID: 0
  128. Session ID: 0 Serial number: 0
  129.  
  130.  
  131. Warning: You are no longer connected to ORACLE.
  132. SQL> conn test/test@pdborcl
  133. ERROR:
  134. ORA-01033: ORACLE initialization or shutdown in progress
  135. Process ID: 0
  136. Session ID: 0 Serial number: 0
  137.  
  138.  
  139. SQL> conn sys as sysdba
  140. Enter password:
  141. Connected.
  142. SQL> conn sys@pdborcl as sysdba
  143. Enter password:
  144. Connected.
  145. SQL> Create user test identified by test
  146. 2 Default tablespace users
  147. 3 Temporary tablespace temp
  148. 4 Quota unlimited on users;
  149. Create user test identified by test
  150. *
  151. ERROR at line 1:
  152. ORA-01109: database not open
  153.  
  154.  
  155. SQL> Grant create session, create procedure to test;
  156. Grant create session, create procedure to test
  157. *
  158. ERROR at line 1:
  159. ORA-01109: database not open
  160.  
  161.  
  162. SQL> Grant execute on list_libraries to test;
  163. Grant execute on list_libraries to test
  164. *
  165. ERROR at line 1:
  166. ORA-01109: database not open
  167.  
  168.  
  169. SQL> alter pluggable database pdborcl open read write;
  170.  
  171. Pluggable database altered.
  172.  
  173. SQL> conn test/test@pdborcl
  174. Connected.
  175. SQL> exec sys.list_libraries('NOUSER''||test.get_dba() --');
  176. BEGIN sys.list_libraries('NOUSER''||test.get_dba() --'); END;
  177.  
  178. *
  179. ERROR at line 1:
  180. ORA-06598: insufficient INHERIT PRIVILEGES privilege
  181. ORA-06512: at "TEST.GET_DBA", line 1
  182. ORA-06512: at "SYS.LIST_LIBRARIES", line 9
  183. ORA-06512: at line 1
  184.  
  185.  
  186. SQL> conn sys as sysdba
  187. Enter password:
  188. Connected.
  189. SQL> alter system switch logfile;
  190.  
  191. System altered.
  192.  
  193. SQL> begin
  194. 2 dbms_logmnr.add_logfile( LogFileName =>’C:/app/backup/archive/ARC0000000240_0922032286.0001’,
  195. 3 options => DBMS_LOGMNR.NEW);
  196. 4 end;
  197. 5 /
  198.  
  199. PL/SQL procedure successfully completed.
  200.  
  201. SQL> begin
  202. 2 dbms_logmnr.add_logfile( LogFileName =>
  203. 3 ' C:/app/backup/CDB1/archivelog/2016_10_31/ ARC0000000241_0922032286.0001',
  204. 4 options => DBMS_LOGMNR.ADDFILE);
  205. 5 end;
  206. 6 /
  207. begin
  208. *
  209. ERROR at line 1:
  210. ORA-01284: file C:/app/backup/CDB1/archivelog/2016_10_31/ ARC0000000241_0922032286.0001 cannot be opened
  211. ORA-00308: cannot open archived log ' C:/app/backup/CDB1/archivelog/2016_10_31/ ARC0000000241_0922032286.0001'
  212. ORA-27041: unable to open file
  213. OSD-04002: unable to open file
  214. O/S-Error: (OS 123) The filename, directory name, or volume label syntax is incorrect.
  215. ORA-06512: at "SYS.DBMS_LOGMNR", line 68
  216. ORA-06512: at line 2
  217.  
  218.  
  219. SQL> begin
  220. 2 dbms_logmnr.add_logfile( LogFileName =>
  221. 3 'C:/app/backup/archive/ARC0000000241_0922032286.0001',
  222. 4 options => DBMS_LOGMNR.ADDFILE);
  223. 5 end;
  224. 6 /
  225.  
  226. PL/SQL procedure successfully completed.
  227.  
  228. SQL> begin
  229. 2 dbms_logmnr.add_logfile( LogFileName =>
  230. 3 'C:/app/backup/archive/ARC0000000242_0922032286.0001',
  231. 4 options => DBMS_LOGMNR.ADDFILE);
  232. 5 end;
  233. 6 /
  234.  
  235. PL/SQL procedure successfully completed.
  236.  
  237. SQL> begin
  238. 2 dbms_logmnr.start_logmnr( options => dbms_logmnr.dict_from_redo_logs +
  239. 3 dbms_logmnr.ddl_dict_tracking +
  240. 4 dbms_logmnr.print_pretty_sql);
  241. 5 end;
  242. 6 /
  243. begin
  244. *
  245. ERROR at line 1:
  246. ORA-01371: Complete LogMiner dictionary not found
  247. ORA-06512: at "SYS.DBMS_LOGMNR", line 58
  248. ORA-06512: at line 2
  249.  
  250.  
  251. SQL> Execute dbms_logmnr.start_logmnr( -
  252. > DICTFILENAME => 'C:\app\backup\logmnr\dictionary.ora');
  253.  
  254. PL/SQL procedure successfully completed.
  255.  
  256. SQL> Select username, operation, sql_redo, sql_undo from v$logmnr_contents where username =’TEST’;
  257.  
  258. no rows selected
  259.  
  260. SQL>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement