單例項和RAC下建立表空間的小區別

oracle_mao發表於2011-12-29

單例項和RAC下建立表空間的小區別

單例項下:
SQL> select instance_number ,instance_name from v$instance;

INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
              1 orcl

SQL> show parameter db_c

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_cache_advice                      string      ON
db_cache_size                        big integer 0
db_create_file_dest                  string       ------------------------指定資料檔案預設存放位置
db_create_online_log_dest_1          string ------------------------指定redo和控制檔案預設存放位置
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> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/pmsdb/oracle/oradata/orcl/system01.dbf
/pmsdb/oracle/oradata/orcl/sysaux101.dbf
/pmsdb/oracle/oradata/orcl/undotbs101.dbf
/pmsdb/oracle/oradata/orcl/users101.dbf
/pmsdb/oracle/oradata/orcl/user102.dbf
/pmsdb/oracle/oradata/orcl/mao01.dbf
/pmsdb/oracle/oradata/orcl/mao02.dbf

7 rows selected.

SQL> create tablespace tbs;
create tablespace tbs
                    *
ERROR at line 1:
ORA-02199: missing DATAFILE/TEMPFILE clause


SQL> alter system set db_create_file_dest='/pmsdb/oracle/oradata/orcl/';

System altered.

SQL>  create tablespace tbs;

Tablespace created.

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/pmsdb/oracle/oradata/orcl/system01.dbf
/pmsdb/oracle/oradata/orcl/sysaux101.dbf
/pmsdb/oracle/oradata/orcl/undotbs101.dbf
/pmsdb/oracle/oradata/orcl/users101.dbf
/pmsdb/oracle/oradata/orcl/user102.dbf
/pmsdb/oracle/oradata/orcl/mao01.dbf
/pmsdb/oracle/oradata/orcl/mao02.dbf
/pmsdb/oracle/oradata/orcl/PTLD1/datafile/o1_mf_tbs_7hqrlckm_.dbf

8 rows selected.

SQL> set linesize 200
SQL> col name for a50
SQL> select name,bytes/1024/1024 from v$datafile;

NAME                                               BYTES/1024/1024
-------------------------------------------------- ---------------
/pmsdb/oracle/oradata/orcl/system01.dbf                        990
/pmsdb/oracle/oradata/orcl/sysaux101.dbf                       860
/pmsdb/oracle/oradata/orcl/undotbs101.dbf                      440
/pmsdb/oracle/oradata/orcl/users101.dbf                    1116.25
/pmsdb/oracle/oradata/orcl/user102.dbf                          10
/pmsdb/oracle/oradata/orcl/mao01.dbf                           100
/pmsdb/oracle/oradata/orcl/mao02.dbf                           100
/pmsdb/oracle/oradata/orcl/PTLD1/datafile/o1_mf_tb             100
s_7hqrlckm_.dbf


8 rows selected.

RAC下:

SQL> select instance_number,instance_name from v$instance;

INSTANCE_NUMBER INSTANCE_NAME
--------------- --------------------------------
              2 ORA11G2

SQL> show parameter db_create

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
db_create_file_dest                  string
+DATA_ORA11G
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

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------

db_create_online_log_dest_5          string

 

由此可見,在rac裡,引數db_create_file_dest預設已經被指定好了,而在單例項中,引數db_create_file_dest 是需要手動指定的。因為這就解釋了rac中建立表空間時不需要寫目錄和名字,原來在單例項中也是可以的。

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24500180/viewspace-714136/,如需轉載,請註明出處,否則將追究法律責任。

相關文章