Database Reference
In-Depth Information
The first *.ctl is the active control file. Then issue the following command to enable a readable copy of the
control file:
SQL> ALTER DATABASE BACKUP controlfile TO trace;
You can find the trace file, which is a backup of the control file, in the udump directory. It is a binary file but can
be read directly using the xxd below. For example:
[root@ol6 ~]# xxd /u01/app/oracle/oradata/orcl/control01.ctl | less | egrep -i '*\.dbf'
007c660: 7365 7273 3031 2e64 6266 0000 0000 0000 sers01.dbf......
007c870: 6273 3031 2e64 6266 0000 0000 0000 0000 bs01.dbf........
007cc80: 636c 2f73 7973 7465 6d30 312e 6462 6600 cl/ system01.dbf .
007ce90: 656d 7030 312e 6462 6600 0000 0000 0000 emp01.dbf.......
007d0a0: 6c65 3031 2e64 6266 0000 0000 0000 0000 le01.dbf........
We can see that the current system tablespace is writing to system01.dbf.
Next we will check for the state of dbms_utility in the data file, from root, so that Oracle processes can't
interfere. This is where the system tablespace data file lives.
[root@ol6 ~]# ls /u01/app/oracle/oradata/orcl/
control01.ctl redo01.log redo03.log system01.dbf undotbs01.dbf
example01.dbf redo02.log sysaux01.dbf temp01.dbf users01.dbf
The system tablespace is big even when not in use. The one on my test system is 791MB in size:
[root@ol6 ~]# ls -shalt /u01/app/oracle/oradata/orcl/system01.dbf
791M -rw-r-----. 1 oracle oinstall 791M Jan 17 14:06 /u01/app/oracle/oradata/orcl/system01.dbf
In a production database the system tablespace may be extended over multiple data files. Remember that the
system tablespace need not just be in system01.dbf, and that it is possible to rename data files, as shown below.
ALTER TABLESPACE SYSTEM RENAME DATAFILE '/home/oracle/app/oracle2/oradata/orcl3/system01.dbf' TO '/
home/oracle/app/oracle2/oradata/orcl3/system02.dbf' ;
Note that the SYSTEM tablespace cannot be made read-only, which is why we have to monitor its state. To do
that, we could read the binary file in these ways:
od -x /home/oracle/app/oracle/oradata/orcl/orcl_plug/system01.dbf
vi -b /home/oracle/app/oracle/oradata/orcl/orcl_plug/system01.dbf
:set noeol
:set binary
:%!xxd
:%!xxd -r to exit from hex mode.
But vi and xxd are not great for reading from large data files. In my experience, the best way to state check a
package in a data file is to generate a checksum as follows:
[root@ol6 ~]# cat /u01/app/oracle/oradata/orcl/system01.dbf | strings | pcregrep -M -A 70 'package
body dbms_utility' | md5sum
09631f77b57f80779d51ddb7890e4589
Search WWH ::




Custom Search