分类: Oracle
2006-04-01 14:07:55
blue_stone@blueice:~/test$ orapwd Usage: orapwd file= where file - name of password file (mand), password - password for SYS (mand), entries - maximum number of distinct DBA and OPERs (opt), There are no spaces around the equal-to (=) character. |
blue_stone@blueice:~/test$ orapwd file=233.ora Usage: orapwd file= where file - name of password file (mand), password - password for SYS (mand), entries - maximum number of distinct DBA and OPERs (opt), There are no spaces around the equal-to (=) character. blue_stone@blueice:~/test$ orapwd password=abcdef Usage: orapwd file= where file - name of password file (mand), password - password for SYS (mand), entries - maximum number of distinct DBA and OPERs (opt), There are no spaces around the equal-to (=) character. |
blue_stone@blueice:~/test$ orapwd file=233.ora password=abcdef blue_stone@blueice:~/test$ ls -al 233.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 09:27 233.ora |
SQL> select * from v$pwfile_users; USERNAME SYSDB SYSOP ------------------------------ ----- ----- SYS TRUE TRUE |
#!/bin/bash # File Name : pwtest.sh # Usage : Create some oracle password file and analyze them. n=0 while [ $n -le 20 ] do orapwd file=$n.ora password=oracle entries=$n hexdump $n.ora > $n.dmp n=$(($n+1)) done n=0 while [ $n -le 20 ] do ls -al $n.ora n=$((n+1)) done n=0 while [ $n -le 20 ] do md5sum $n.ora n=$((n+1)) done |
blue_stone@blueice:~/test$ ./pwtest.sh -rwSr----- 1 blue_stone user 1536 2006-04-01 10:07 0.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 10:07 1.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 10:07 2.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 10:07 3.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 10:07 4.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 10:07 5.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 10:07 6.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 10:07 7.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 10:07 8.ora -rwSr----- 1 blue_stone user 2560 2006-04-01 10:07 9.ora -rwSr----- 1 blue_stone user 2560 2006-04-01 10:07 10.ora -rwSr----- 1 blue_stone user 2560 2006-04-01 10:07 11.ora -rwSr----- 1 blue_stone user 2560 2006-04-01 10:07 12.ora -rwSr----- 1 blue_stone user 3072 2006-04-01 10:07 13.ora -rwSr----- 1 blue_stone user 3072 2006-04-01 10:07 14.ora -rwSr----- 1 blue_stone user 3072 2006-04-01 10:07 15.ora -rwSr----- 1 blue_stone user 3072 2006-04-01 10:07 16.ora -rwSr----- 1 blue_stone user 3584 2006-04-01 10:07 17.ora -rwSr----- 1 blue_stone user 3584 2006-04-01 10:07 18.ora -rwSr----- 1 blue_stone user 3584 2006-04-01 10:07 19.ora -rwSr----- 1 blue_stone user 3584 2006-04-01 10:07 20.ora c16f9293603f290409d2f495217e6262 0.ora c16f9293603f290409d2f495217e6262 1.ora c16f9293603f290409d2f495217e6262 2.ora c16f9293603f290409d2f495217e6262 3.ora c16f9293603f290409d2f495217e6262 4.ora 1bc8a7b9789922356fc9b804e02ea2c8 5.ora 1bc8a7b9789922356fc9b804e02ea2c8 6.ora 1bc8a7b9789922356fc9b804e02ea2c8 7.ora 1bc8a7b9789922356fc9b804e02ea2c8 8.ora 3c76d4e09b4cf3e7cf8ad69db2519ff6 9.ora 3c76d4e09b4cf3e7cf8ad69db2519ff6 10.ora 3c76d4e09b4cf3e7cf8ad69db2519ff6 11.ora 3c76d4e09b4cf3e7cf8ad69db2519ff6 12.ora 6604f4088b58fc57cad8d496814ee928 13.ora 6604f4088b58fc57cad8d496814ee928 14.ora 6604f4088b58fc57cad8d496814ee928 15.ora 6604f4088b58fc57cad8d496814ee928 16.ora 9c16648155e3387d74c8c63845c33595 17.ora 9c16648155e3387d74c8c63845c33595 18.ora 9c16648155e3387d74c8c63845c33595 19.ora 9c16648155e3387d74c8c63845c33595 20.ora |
blue_stone@blueice:~/test$ diff 0.dmp 1.dmp blue_stone@blueice:~/test$ diff 0.dmp 2.dmp blue_stone@blueice:~/test$ diff 0.dmp 3.dmp blue_stone@blueice:~/test$ diff 0.dmp 4.dmp blue_stone@blueice:~/test$ diff 7.dmp 5.dmp blue_stone@blueice:~/test$ diff 11.dmp 9.dmp blue_stone@blueice:~/test$ diff 16.dmp 13.dmp blue_stone@blueice:~/test$ diff 19.dmp 17.dmp |
0000000 0000 0000 0200 0000 0002 0000 5c5d 5a5b 0000010 0000 0000 0000 0000 0000 0000 0000 0000 * 0000200 524f 4341 454c 5220 6d65 746f 2065 6150 0000210 7373 6f77 6472 6620 6c69 0065 0000 001b 0000220 0000 0000 0000 0000 0000 0000 0000 0000 * 0000260 4e49 4554 4e52 4c41 0000 0000 0000 0000 0000270 0000 0000 0000 0000 0000 0000 0000 0000 0000280 0008 0000 4241 3732 3542 4533 4344 4635 0000290 4645 3134 0000 0000 0000 0000 0000 0000 00002a0 0000 0000 0010 0000 000f 0000 0000 0000 00002b0 0000 0000 0000 0000 0000 0000 0000 0000 00002c0 0000 0000 0000 0000 5953 0053 0000 0000 00002d0 0000 0000 0000 0000 0000 0000 0000 0000 00002e0 0000 0000 0000 0000 0003 0000 4138 4638 00002f0 3230 3735 3733 3941 3930 4137 0000 0000 0000300 0000 0000 0000 0000 0000 0000 0010 0000 0000310 000f 0000 0000 0000 0000 0000 0000 0000 0000320 0000 0000 0000 0000 0000 0000 0000 0000 * 0000600 |
blue_stone@blueice:~/test$ more 5.dmp 0000000 0000 0000 0200 0000 0003 0000 5c5d 5a5b 0000010 0000 0000 0000 0000 0000 0000 0000 0000 * 0000200 524f 4341 454c 5220 6d65 746f 2065 6150 0000210 7373 6f77 6472 6620 6c69 0065 0000 001b 0000220 0000 0000 0000 0000 0000 0000 0000 0000 * 0000260 4e49 4554 4e52 4c41 0000 0000 0000 0000 0000270 0000 0000 0000 0000 0000 0000 0000 0000 0000280 0008 0000 4241 3732 3542 4533 4344 4635 0000290 4645 3134 0000 0000 0000 0000 0000 0000 00002a0 0000 0000 0010 0000 000f 0000 0000 0000 00002b0 0000 0000 0000 0000 0000 0000 0000 0000 00002c0 0000 0000 0000 0000 5953 0053 0000 0000 00002d0 0000 0000 0000 0000 0000 0000 0000 0000 00002e0 0000 0000 0000 0000 0003 0000 4138 4638 00002f0 3230 3735 3733 3941 3930 4137 0000 0000 0000300 0000 0000 0000 0000 0000 0000 0010 0000 0000310 000f 0000 0000 0000 0000 0000 0000 0000 0000320 0000 0000 0000 0000 0000 0000 0000 0000 * 0000800 |
blue_stone@blueice:~/test$ diff 1.dmp 5.dmp 1c1 < 0000000 0000 0000 0200 0000 0002 0000 5c5d 5a5b --- > 0000000 0000 0000 0200 0000 0003 0000 5c5d 5a5b 22c22 < 0000600 --- > 0000800 |
#!/bin/bash # File Name : pwtest2.sh # Usage : Create some oracle password file with the entires parameter # : like 0*65536 + m, 1*65536 + m ......, then analyze them. m=5 n=0 while [ $n -le 20 ] do orapwd file=$(($n*65536+$m)).ora password=oracle entries=$(($n*65536+$m)) n=$(($n+1)) done n=0 while [ $n -le 20 ] do ls -al $(($n*65536+$m)).ora n=$((n+1)) done n=0 while [ $n -le 20 ] do md5sum $(($n*65536+$m)).ora n=$((n+1)) done |
blue_stone@blueice:~/test$ ./pwtest2.sh -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 5.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 65541.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 131077.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 196613.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 262149.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 327685.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 393221.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 458757.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 524293.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 589829.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 655365.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 720901.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 786437.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 851973.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 917509.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 983045.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 1048581.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 1114117.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 1179653.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 1245189.ora -rwSr----- 1 blue_stone user 2048 2006-04-01 12:23 1310725.ora 1bc8a7b9789922356fc9b804e02ea2c8 5.ora 1bc8a7b9789922356fc9b804e02ea2c8 65541.ora 1bc8a7b9789922356fc9b804e02ea2c8 131077.ora 1bc8a7b9789922356fc9b804e02ea2c8 196613.ora 1bc8a7b9789922356fc9b804e02ea2c8 262149.ora 1bc8a7b9789922356fc9b804e02ea2c8 327685.ora 1bc8a7b9789922356fc9b804e02ea2c8 393221.ora 1bc8a7b9789922356fc9b804e02ea2c8 458757.ora 1bc8a7b9789922356fc9b804e02ea2c8 524293.ora 1bc8a7b9789922356fc9b804e02ea2c8 589829.ora 1bc8a7b9789922356fc9b804e02ea2c8 655365.ora 1bc8a7b9789922356fc9b804e02ea2c8 720901.ora 1bc8a7b9789922356fc9b804e02ea2c8 786437.ora 1bc8a7b9789922356fc9b804e02ea2c8 851973.ora 1bc8a7b9789922356fc9b804e02ea2c8 917509.ora 1bc8a7b9789922356fc9b804e02ea2c8 983045.ora 1bc8a7b9789922356fc9b804e02ea2c8 1048581.ora 1bc8a7b9789922356fc9b804e02ea2c8 1114117.ora 1bc8a7b9789922356fc9b804e02ea2c8 1179653.ora 1bc8a7b9789922356fc9b804e02ea2c8 1245189.ora 1bc8a7b9789922356fc9b804e02ea2c8 1310725.ora |
blue_stone@blueice:~/test$ orapwd file=1.ora password=oracle entries=1 blue_stone@blueice:~/test$ orapwd file=default.ora password=oracle blue_stone@blueice:~/test$ md5sum 1.ora default.ora c16f9293603f290409d2f495217e6262 1.ora c16f9293603f290409d2f495217e6262 default.ora blue_stone@blueice:~/test$ ls -al 1.ora default.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 13:09 1.ora -rwSr----- 1 blue_stone user 1536 2006-04-01 13:09 default.ora |
blueice:~# tune2fs -l /dev/hda6 tune2fs 1.39-WIP (31-Dec-2005) Filesystem volume name: Last mounted on: Filesystem UUID: 0f4eb2b4-1360-48a1-8b66-3916a6838210 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal filetype needs_recovery sparse_super Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 3057824 Block count: 6104692 Reserved block count: 305234 Free blocks: 1002160 Free inodes: 2930491 First block: 0 Block size: 4096 Fragment size: 4096 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 16352 Inode blocks per group: 511 Filesystem created: Sat Sep 3 16:33:16 2005 Last mount time: Sat Apr 1 08:10:43 2006 Last write time: Sat Apr 1 08:10:43 2006 Mount count: 8 Maximum mount count: 22 Last checked: Sat Mar 25 20:15:04 2006 Check interval: 15552000 (6 months) Next check after: Thu Sep 21 20:15:04 2006 Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal inode: 8 Default directory hash: tea Directory Hash Seed: 70ac7131-5a92-4ca3-865d-4ce83f38acb1 Journal backup: inode blocks |
blueice:/home/blue_stone/test# dd if=/dev/zero of=testfile bs=1M count=20 20+0 records in 20+0 records out 20971520 bytes (21 MB) copied, 0.449763 seconds, 46.6 MB/s blueice:/home/blue_stone/test# mkfs.ext3 -b 1024 testfile mke2fs 1.39-WIP (31-Dec-2005) testfile is not a block special device. Proceed anyway? (y,n) y Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 5136 inodes, 20480 blocks 1024 blocks (5.00%) reserved for the super user First data block=1 3 block groups 8192 blocks per group, 8192 fragments per group 1712 inodes per group Superblock backups stored on blocks: 8193 Writing inode tables: done Creating journal (1024 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 21 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. blueice:/home/blue_stone/test# mkdir test blueice:/home/blue_stone/test# mount testfile test -o loop blueice:/home/blue_stone/test# mount /dev/hda1 on / type ext3 (rw,errors=remount-ro) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) usbfs on /proc/bus/usb type usbfs (rw) tmpfs on /dev/shm type tmpfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/hda3 on /mnt/amd64 type ext3 (rw) /dev/hda6 on /home type ext3 (rw) /dev/hda9 on /bak type ext3 (rw) /dev/hda7 on /vmware type ext3 (rw) tmpfs on /dev type tmpfs (rw,size=10M,mode=0755) nfsd on /proc/fs/nfsd type nfsd (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /home/blue_stone/test/testfile on /home/blue_stone/test/test type ext3 (rw,loop=/dev/loop/0) blueice:/home/blue_stone/test# tune2fs -l testfile tune2fs 1.39-WIP (31-Dec-2005) Filesystem volume name: Last mounted on: Filesystem UUID: 561bb9bf-2455-4677-aa0d-27c868aa99fd Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal filetype needs_recovery sparse_super Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 5136 Block count: 20480 Reserved block count: 1024 Free blocks: 18784 Free inodes: 5125 First block: 1 Block size: 1024 Fragment size: 1024 Blocks per group: 8192 Fragments per group: 8192 Inodes per group: 1712 Inode blocks per group: 214 Filesystem created: Sat Apr 1 12:33:59 2006 Last mount time: Sat Apr 1 12:34:15 2006 Last write time: Sat Apr 1 12:34:15 2006 Mount count: 1 Maximum mount count: 21 Last checked: Sat Apr 1 12:33:59 2006 Check interval: 15552000 (6 months) Next check after: Thu Sep 28 12:33:59 2006 Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal inode: 8 Default directory hash: tea Directory Hash Seed: 02dfc011-04f6-4a92-b763-99fe8aa76e96 Journal backup: inode blocks |
oracle@blueice:~/product/9.2.0/dbs$ rm orapworcl oracle@blueice:~/product/9.2.0/dbs$ orapwd file=orapworcl password=oracle oracle@blueice:~/product/9.2.0/dbs$ hexdump -v orapworcl >default.dmp oracle@blueice:~/product/9.2.0/dbs$ sqlplus /nolog SQL*Plus: Release 9.2.0.4.0 - Production on Sat Apr 1 13:14:22 2006 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SQL> conn sys/oracle as sysdba Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 147920392 bytes Fixed Size 452104 bytes Variable Size 121634816 bytes Database Buffers 25165824 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> select * from v$pwfile_users 2 ; USERNAME SYSDB SYSOP ------------------------------ ----- ----- SYS TRUE TRUE SQL> grant sysdba to scott,hr,sh,xdb; Grant succeeded. SQL> grant sysdba to wmsys; grant sysdba to wmsys * ERROR at line 1: ORA-01996: GRANT failed: password file '/home/oracle/product/9.2.0/dbs/orapworcl' is full SQL> select * from v$pwfile_users 2 ; USERNAME SYSDB SYSOP ------------------------------ ----- ----- SYS TRUE TRUE SCOTT TRUE FALSE HR TRUE FALSE SH TRUE FALSE XDB TRUE FALSE |
oracle@blueice:~/product/9.2.0/dbs$ strings orapworcl ]\[Z ORACLE Remote Password file ORCL INTERNAL 2C0791C2F3E3BB92 D4C5016086B2DC6A r1BSCOTT F894844C34402B67 6399F3B38EDF3288 9793B3777CD3BD1A 88D8364765FCE6AF oracle@blueice:~/product/9.2.0/dbs$ sqlplus /nolog SQL*Plus: Release 9.2.0.4.0 - Production on Sat Apr 1 13:51:20 2006 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SQL> conn / as sysdba Connected. SQL> select password from dba_users where username in ('HR','SH','SCOTT','XDB'); PASSWORD ------------------------------ 88D8364765FCE6AF F894844C34402B67 9793B3777CD3BD1A 6399F3B38EDF3288 SQL> exit Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production |