Step 1:
创建测试表空间。
SQL> create tablespace test datafile '/u01/app/oracle/oradata/orcl/test01.dbf' size 1m;
Tablespace created.
Step 2:
创建测试用户。
SQL> create user test identified by test;
User created.
Step 3:
将测试用户的默认表空间更改为test表空间。
SQL> alter user test default tablespace test;
User altered.
Step 4:
用test用户连接数据库。
[oracle@localhost ~]$ sqlplus "test/test" SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 25 18:55:38 2011 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
Step 5:
查看test用户的schema下的object数量。
SQL> select count(*) from user_objects;
COUNT(*)
---------- 0
Step 6:
在test用户的schema下创建测试表mytest。
SQL> create table mytest(name varchar(20)); Table created.
Step 7:
向测试表mytest中插入一条记录。
SQL> insert into mytest values('freas');
1 row created.
Step 8:
在dba的窗口下刷buffer cache。
SQL> alter system flush buffer_cache; System altered.
Step 9:
在bash shell中用strings命令查看第一条记录"freas"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "freas" Freas
注:此处有输出,说明Oracle已经将"freas"写入数据文件中。
Step 10:
向测试表mytest中插入一条记录。
SQL> insert into mytest values('tangtang');
1 row created.
Step 11:
重复第9步操作,查看第二条记录"tangtang"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "tangtang"
注:此处没有输出,说明Oracle没有将"tangtang"写入数据文件中,数据目前仍然停留在buffer cache中的。
Step 12:
等待约1分钟,重复第9步操作,查看第二条记录"tangtang"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "tangtang"
注:此处没有输出,说明Oracle没有将"tangtang"写入数据文件中,数据目前仍然停留在buffer cache中的。
Step 13:
在sys用户下,再建一个铺助测试表test_aux,用于加强系统繁忙程度。
a、 SQL> create table test_aux as select * from dba_objects;
Table created.
b、SQL> insert into test_aux select * from test_aux;
72713 rows
SQL>/
145426 rows created.
SQL> /
290852 rows created.
Step 14:
重复第9步操作,查看第二条记录"tangtang"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "tangtang" tangtang,
注:此处有输出,说明Oracle已经将"tangtang"写入数据文件中。
创建测试表空间。
SQL> create tablespace test datafile '/u01/app/oracle/oradata/orcl/test01.dbf' size 1m;
Tablespace created.
Step 2:
创建测试用户。
SQL> create user test identified by test;
User created.
Step 3:
将测试用户的默认表空间更改为test表空间。
SQL> alter user test default tablespace test;
User altered.
Step 4:
用test用户连接数据库。
[oracle@localhost ~]$ sqlplus "test/test" SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 25 18:55:38 2011 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
Step 5:
查看test用户的schema下的object数量。
SQL> select count(*) from user_objects;
COUNT(*)
---------- 0
Step 6:
在test用户的schema下创建测试表mytest。
SQL> create table mytest(name varchar(20)); Table created.
Step 7:
向测试表mytest中插入一条记录。
SQL> insert into mytest values('freas');
1 row created.
Step 8:
在dba的窗口下刷buffer cache。
SQL> alter system flush buffer_cache; System altered.
Step 9:
在bash shell中用strings命令查看第一条记录"freas"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "freas" Freas
注:此处有输出,说明Oracle已经将"freas"写入数据文件中。
Step 10:
向测试表mytest中插入一条记录。
SQL> insert into mytest values('tangtang');
1 row created.
Step 11:
重复第9步操作,查看第二条记录"tangtang"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "tangtang"
注:此处没有输出,说明Oracle没有将"tangtang"写入数据文件中,数据目前仍然停留在buffer cache中的。
Step 12:
等待约1分钟,重复第9步操作,查看第二条记录"tangtang"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "tangtang"
注:此处没有输出,说明Oracle没有将"tangtang"写入数据文件中,数据目前仍然停留在buffer cache中的。
Step 13:
在sys用户下,再建一个铺助测试表test_aux,用于加强系统繁忙程度。
a、 SQL> create table test_aux as select * from dba_objects;
Table created.
b、SQL> insert into test_aux select * from test_aux;
72713 rows
SQL>/
145426 rows created.
SQL> /
290852 rows created.
Step 14:
重复第9步操作,查看第二条记录"tangtang"是否已经写入数据文件了。
[oracle@localhost ~]$ strings /u01/app/oracle/oradata/orcl/test01.dbf|grep "tangtang" tangtang,
注:此处有输出,说明Oracle已经将"tangtang"写入数据文件中。
![](http://img.blog.itpub.net/blog/attachment/201704/5/31448824_1491369188faWN.png?x-oss-process=style/bb)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31448824/viewspace-2136603/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31448824/viewspace-2136603/