WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606
全部博文(599)
分类: Oracle
2012-08-17 22:34:54
[oracle@db2server huateng]$ sqlplus -v
SQL*Plus: Release 11.2.0.1.0 Production
[oracle@db2server huateng]$ ls -ltr htyansp01.dbf
-rw-r--r-- 1 oracle oinstall 60620800 Aug 16 07:33 htyansp01.dbf
[oracle@db2server huateng]$ dd if=/dev/zero of=htyansp01.dbf bs=4096 count=1 seek=14800 conv=notrunc
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000354954 seconds, 11.5 MB/s
[oracle@db2server huateng]$ ls -ltr htyansp01.dbf
-rw-r--r-- 1 oracle oinstall 60624896 Aug 16 14:15 htyansp01.dbf
[oracle@db2server ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 16 14:18:06 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 380817408 bytes
Fixed Size 1336680 bytes
Variable Size 268438168 bytes
Database Buffers 104857600 bytes
Redo Buffers 6184960 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/huateng/htyansp01.dbf'
SQL>
ALTER DATABASE MOUNT
2012-08-16 14:18:28.254000 +08:00
Successful mount of redo thread 1, with mount id 2136189040
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
ALTER DATABASE OPEN
Errors in file /u01/app/oracle/diag/rdbms/huateng/huateng/trace/huateng_dbw0_8444.trc:
ORA-01157: ????/?????? 6 - ??? DBWR ????
ORA-01110: ???? 6: '/u01/app/oracle/oradata/huateng/htyansp01.dbf'
ORA-27046: ??????????????
Additional information: 1
Errors in file /u01/app/oracle/diag/rdbms/huateng/huateng/trace/huateng_ora_8536.trc:
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/huateng/htyansp01.dbf'
ORA-1157 signalled during: ALTER DATABASE OPEN...
ORA-01200: actual file size of 7399 is smaller than correct size of 12800。
SQL> select file#,name,blocks from v$datafile;
FILE# NAME BLOCKS
---------- -------------------------------------------------- ----------
1 /u01/app/oracle/oradata/huateng/system01.dbf 88320
2 /u01/app/oracle/oradata/huateng/sysaux01.dbf 62720
3 /u01/app/oracle/oradata/huateng/undotbs01.dbf 10880
4 /u01/app/oracle/oradata/huateng/users01.dbf 640
5 /u01/app/oracle/oradata/huateng/example01.dbf 12800
6 /u01/app/oracle/oradata/huateng/htyansp01.dbf 0
7 /u01/app/oracle/oradata/huateng/file01.dbf 2000
[oracle@db2server huateng]$ dd if=htyansp01.dbf of=new.dbf bs=8192 count=7400
7400+0 records in
7400+0 records out
60620800 bytes (61 MB) copied, 0.93832 seconds, 64.6 MB/s
[oracle@db2server huateng]$ ls -ltr new.dbf
-rw-r--r-- 1 oracle oinstall 60620800 08-16 14:36 new.dbf
[oracle@db2server huateng]$ rm -rf htyansp01.dbf
[oracle@db2server huateng]$ mv new.dbf htyansp01.dbf
[oracle@db2server huateng]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 16 14:36:27 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 380817408 bytes
Fixed Size 1336680 bytes
Variable Size 268438168 bytes
Database Buffers 104857600 bytes
Redo Buffers 6184960 bytes
Database mounted.
Database opened.
SQL> create table t(id int) tablespace htyansp;
Table created.