Oracle引入了文件自动管理功能。默认情况下系统在创建表空间的时候是需要指定数据文件,创建日志组的时候也需要指定数据文件;但如果你指定了系统中的db_create_file_dest和db_create_online_log_dest_n后,系统在创建表空间和日志组的时候可以不指定数据文件而是使用db_create_file_dest和db_create_online_log_dest_n指定路径的文件夹里面创建相应的数据文件,默认是100M。当你使用drop tablespace test命令删除表空间或日志组的话,系统会自动删除之前创建的数据文件。
注意:如果你是使用手工指定数据文件的地址,当你删除表空间或日志组文件的时候,系统是不会删除你的数据文件的。
SQL> create tablespace test;
create tablespace test
*
ERROR at line 1:
ORA-02199: missing DATAFILE/TEMPFILE clause
SQL> show parameter db_create;
NAME TYPE VALUE
------------------------------------ ----------- --------------------
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
SQL> alter system set db_create_file_dest='c:oradb' ;
System altered.
SQL> show parameter db_create;
NAME TYPE VALUE
------------------------------------ ----------- --------------------
db_create_file_dest string c:oradb
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
SQL> create tablespace test;
Tablespace created.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13062352/viewspace-614251/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13062352/viewspace-614251/