Specifying CREATE DATABASE Statement
Clauses
龍沙ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書合作)期待與您的合作!
When you execute a CREATE DATABASE statement, Oracle Database performs several operations. The actual operations performed depend on the clauses that you specify in the CREATE DATABASE statement and the initialization parameters that you have set. Oracle Database performs at least these operations:
執(zhí)行CREATE DATABASE語句時(shí),Oracle數(shù)據(jù)庫將執(zhí)行多個(gè)操作。 執(zhí)行的實(shí)際操作取決于您在CREATE DATABASE語句中指定的子句和您設(shè)置的初始化參數(shù)。 Oracle數(shù)據(jù)庫至少執(zhí)行以下操作:
This section discusses several of the clauses of the CREATE DATABASE statement. It expands upon some of the clauses discussed in "Step 9: Issue the CREATE DATABASE Statement" and introduces additional ones. Many of the CREATE DATABASE clauses discussed here can be used to simplify the creation and management of your database.
The following topics are contained in this section:
Protecting Your Database: Specifying Passwords for Users SYS and SYSTEM
The clauses of the CREATE DATABASE statement used for specifying the passwords for users SYS and SYSTEM are:
If you omit these clauses, then these users are assigned the default passwords change_on_install and manager, respectively. A record is written to the alert log indicating that the default passwords were used. To protect your database, you must change these passwords using the ALTER USER statement immediately after database creation.
如果省略這些子句,則分別為這些用戶分配默認(rèn)密碼change_on_install和manager。 將一條記錄寫入警報(bào)日志,指示使用了默認(rèn)密碼。 為了保護(hù)數(shù)據(jù)庫,您必須在數(shù)據(jù)庫創(chuàng)建后立即使用ALTER USER語句更改這些密碼。
Oracle strongly recommends that you specify these clauses, even though they are optional in this release of Oracle Database. The default passwords are commonly known, and if you neglect to change them later, then you leave database vulnerable to attack by malicious users.
Oracle強(qiáng)烈推薦指定這些子句,即使在此版本的Oracle數(shù)據(jù)庫中它們是可選的。 默認(rèn)密碼是眾所周知的,如果稍后忽略更改密碼,則會(huì)使數(shù)據(jù)庫容易受到惡意用戶的攻擊。
When choosing a password, keep in mind that beginning in Release 11g, passwords are case-sensitive. Also, there may be password formatting requirements for your database. See the section entitled "How Oracle Database Checks the Complexity of Passwords" in Oracle Database Security Guide for more information.
選擇密碼時(shí),請記住,從11g版開始,密碼區(qū)分大小寫。此外,你的數(shù)據(jù)庫可能存在密碼格式化要求。
See Also:
"Some Security Considerations"
Creating a Locally Managed SYSTEM Tablespace
Specify the EXTENT MANAGEMENT LOCAL clause in the CREATE DATABASE statement to create a locally managed SYSTEM tablespace. The COMPATIBLE initialization parameter must be set to 10.0.0 or higher for this statement to be successful. If you do not specify the EXTENT MANAGEMENT LOCAL clause, then by default the database creates a dictionary-managed SYSTEM tablespace. Dictionary-managed tablespaces are deprecated.
在CREATE DATABASE語句中指定EXTENT MANAGEMENT LOCAL子句,以創(chuàng)建本地管理的SYSTEM表空間。 COMPATIBLE初始化參數(shù)必須設(shè)置為10.0.0或更高才能使此語句成功。 如果不指定EXTENT MANAGEMENT LOCAL子句,則默認(rèn)情況下,數(shù)據(jù)庫將創(chuàng)建一個(gè)字典管理的SYSTEM表空間。 字典管理的表空間已被棄用。
If you create your database with a locally managed SYSTEM tablespace, and if you are not using Oracle Managed Files, then ensure that the following conditions are met:
如果使用本地管理的SYSTEM表空間創(chuàng)建數(shù)據(jù)庫,并且如果不使用Oracle Managed Files,那么請確保滿足以下條件:
See Also:
· Oracle Database SQL Language Reference for more specific information about the use of the DEFAULT TEMPORARY TABLESPACE and UNDO TABLESPACE clauses when EXTENT MANAGEMENT LOCAL is specified for the SYSTEM tablespace
· "Locally Managed Tablespaces"
· "Migrating the SYSTEM Tablespace to a Locally Managed Tablespace"
About the SYSAUX Tablespace
The SYSAUX tablespace is always created at database creation. The SYSAUX tablespace serves as an auxiliary tablespace to the SYSTEM tablespace. Because it is the default tablespace for many Oracle Database features and products that previously required their own tablespaces, it reduces the number of tablespaces required by the database. It also reduces the load on the SYSTEM tablespace.
SYSAUX表空間始終在創(chuàng)建數(shù)據(jù)庫時(shí)創(chuàng)建。 SYSAUX表空間用作SYSTEM表空間的輔助表空間。 因?yàn)樗且郧靶枰约旱谋砜臻g的許多Oracle數(shù)據(jù)庫功能和產(chǎn)品的默認(rèn)表空間,因此可以減少數(shù)據(jù)庫所需的表空間數(shù)量。 它還減少了SYSTEM表空間的負(fù)載。
You can specify only datafile attributes for the SYSAUX tablespace, using the SYSAUX DATAFILE clause in the CREATE DATABASE statement. Mandatory attributes of the SYSAUX tablespace are set by Oracle Database and include:
你可以使用CREATE DATABASE語句中的SYSAUX DATAFILE子句來指定SYSAUX表空間的數(shù)據(jù)文件屬性。 SYSAUX表空間的必需屬性由Oracle數(shù)據(jù)庫設(shè)置,包括:
You cannot alter these attributes with an ALTER TABLESPACE statement, and any attempt to do so will result in an error. You cannot drop or rename the SYSAUXtablespace.
不能使用ALTER TABLESPACE語句更改這些屬性,任何嘗試都會(huì)導(dǎo)致錯(cuò)誤。您不能刪除或重命名SYSAUX表空間。
The size of the SYSAUX tablespace is determined by the size of the database components that occupy SYSAUX. You can view a list of these components by querying the V$SYSAUX_OCCUPANTS view. Based on the initial sizes of these components, the SYSAUX tablespace must be at least 400 MB at the time of database creation. The space requirements of the SYSAUX tablespace will increase after the database is fully deployed, depending on the nature of its use and workload. For more information on how to manage the space consumption of the SYSAUX tablespace on an ongoing basis, see the "Managing the SYSAUX Tablespace".
SYSAUX表空間的大小由占用SYSAUX的數(shù)據(jù)庫組件的大小決定。你可以通過查詢V$SYSAUX_OCCUPANTS視圖來查看這些組件的列表。根據(jù)這些組件的初始大小,在創(chuàng)建數(shù)據(jù)庫時(shí),SYSAUX表空間必須至少為400 MB。數(shù)據(jù)庫完全部署后,SYSAUX表空間的空間要求將會(huì)增加,這取決于其使用和工作負(fù)載的性質(zhì)。
If you include a DATAFILE clause for the SYSTEM tablespace, then you must specify the SYSAUX DATAFILE clause as well, or the CREATE DATABASE statement will fail. This requirement does not exist if the Oracle Managed Files feature is enabled (see "Specifying Oracle Managed Files at Database Creation").
如果為SYSTEM表空間包含DATAFILE子句,則必須指定SYSAUX DATAFILE子句,否則CREATE DATABASE語句將失敗。如果啟用Oracle Managed Files功能,則此要求不存在
The SYSAUX tablespace has the same security attributes as the SYSTEM tablespace.
SYSAUX表空間具有與SYSTEM表空間相同的安全屬性。
Note:
This documentation discusses the creation of the SYSAUX database at database creation. When upgrading from a release of Oracle Database that did not require the SYSAUX tablespace, you must create the SYSAUX tablespace as part of the upgrade process. This is discussed in Oracle Database Upgrade Guide.
See Also:"Managing the SYSAUX Tablespace"
在創(chuàng)建數(shù)據(jù)庫時(shí)創(chuàng)建SYSAUX數(shù)據(jù)庫。的、在Oracle數(shù)據(jù)庫版本進(jìn)行升級(jí)時(shí),從不需要SYSAUX表空間,必須在升級(jí)過程中創(chuàng)建SYSAUX表空間。
Using Automatic Undo Management: Creating an Undo Tablespace
Automatic undo management uses an undo tablespace. To enable automatic undo management, set the UNDO_MANAGEMENT initialization parameter to AUTO in your initialization parameter file. Or, omit this parameter, and the database defaults to automatic undo management. In this mode, undo data is stored in an undo tablespace and is managed by Oracle Database. To define and name the undo tablespace yourself, you must include the UNDO TABLESPACE clause in theCREATE DATABASE statement at database creation time. If you omit this clause, and automatic undo management is enabled, then the database creates a default undo tablespace named SYS_UNDOTBS.
自動(dòng)undo管理使用undo表空間。 要啟用自動(dòng)undo管理,請?jiān)诔跏蓟瘏?shù)文件中將UNDO_MANAGEMENT初始化參數(shù)設(shè)置為AUTO。 或者,省略此參數(shù),11g數(shù)據(jù)庫默認(rèn)為自動(dòng)undo管理。 在此模式下,undo數(shù)據(jù)存儲(chǔ)在undo表空間中,由Oracle數(shù)據(jù)庫管理。 要自己定義和命名undo表空間,必須在數(shù)據(jù)庫創(chuàng)建時(shí)將CROTE DATABASE語句中包含UNDO TABLESPACE子句。 如果省略此子句,并啟用自動(dòng)undo管理,則數(shù)據(jù)庫將創(chuàng)建一個(gè)名為SYS_UNDOTBS的缺省的undo表空間。
See Also:
· "Specifying the Method of Undo Space Management"
· Chapter 16, "Managing Undo", for
information about the creation and use of undo tablespaces
Creating a Default Permanent Tablespace
The DEFAULT TABLESPACE clause of the CREATE DATABASE statement specifies a default permanent tablespace for the database. Oracle Database assigns to this tablespace any non-SYSTEM users for whom you do not explicitly specify a different permanent tablespace. If you do not specify this clause, then the SYSTEMtablespace is the default permanent tablespace for non-SYSTEM users. Oracle strongly recommends that you create a default permanent tablespace.
CREATE DATABASE語句中的DEFAULT TABLESPACE子句指定數(shù)據(jù)庫的默認(rèn)永久表空間。 Oracle數(shù)據(jù)庫為此表空間分配任何未明確指定不同永久表空間的非SYSTEM用戶。 如果不指定此子句,則SYSTEM表空間是非SYSTEM用戶的默認(rèn)永久表空間。 Oracle強(qiáng)烈建議創(chuàng)建一個(gè)默認(rèn)的永久表空間。
See Also:
Oracle Database SQL Language Reference for the syntax of the DEFAULT TABLESPACE clause of CREATE DATABASE and ALTER DATABASE
Creating a Default Temporary Tablespace
The DEFAULT TEMPORARY TABLESPACE clause of the CREATE DATABASE statement creates a default temporary tablespace for the database. Oracle Database assigns this tablespace as the temporary tablespace for users who are not explicitly assigned a temporary tablespace.
CREATE DATABASE語句的DEFAULT TEMPORARY TABLESPACE子句創(chuàng)建數(shù)據(jù)庫的默認(rèn)臨時(shí)表空間。 Oracle數(shù)據(jù)庫將這個(gè)表空間分配給沒有顯式分配臨時(shí)表空間的用戶。
You can explicitly assign a temporary tablespace or tablespace group to a user in the CREATE USER statement. However, if you do not do so, and if no default temporary tablespace has been specified for the database, then by default these users are assigned the SYSTEM tablespace as their temporary tablespace. It is not good practice to store temporary data in the SYSTEM tablespace, and it is cumbersome to assign every user a temporary tablespace individually. Therefore, Oracle recommends that you use the DEFAULT TEMPORARY TABLESPACE clause of CREATE DATABASE.
你可以在CREATE USER語句中為用戶顯式分配臨時(shí)表空間或表空間組。 但是,如果不這樣做,并且如果沒有為數(shù)據(jù)庫指定默認(rèn)臨時(shí)表空間,那么默認(rèn)情況下,這些用戶將被分配為SYSTEM表空間作為它們的臨時(shí)表空間。 在SYSTEM表空間中存儲(chǔ)臨時(shí)數(shù)據(jù)是不好的做法,分配每個(gè)用戶一個(gè)臨時(shí)表空間是麻煩的。 因此,Oracle建議使用CREATE DATABASE的DEFAULT TEMPORARY TABLESPACE子句。
Note:
When you specify a locally managed SYSTEM tablespace, the SYSTEM tablespace cannot be used as a temporary tablespace. In this case you must create a default temporary tablespace. Thisbehavior is explained in "Creating a Locally Managed SYSTEM Tablespace".
當(dāng)指定本地管理的SYSTEM表空間時(shí),SYSTEM表空間不能用作臨時(shí)表空間。 在這種情況下,您必須創(chuàng)建一個(gè)默認(rèn)的臨時(shí)表空間。
Specifying Oracle Managed Files at Database Creation
You can minimize the number of clauses and parameters that you specify in your CREATE DATABASE statement by using the Oracle Managed Files feature. You do this by specifying either a directory or Oracle Automatic Storage Management (Oracle ASM) disk group in which your files are created and managed by Oracle Database.
你可以通過使用Oracle托管文件功能來最小化你在CREATE DATABASE語句中指定的子句和參數(shù)數(shù)??梢酝ㄟ^指定由Oracle數(shù)據(jù)庫創(chuàng)建和管理文件的目錄或Oracle自動(dòng)存儲(chǔ)管理(Oracle ASM)磁盤組來執(zhí)行該操作。
By including any of the initialization parameters DB_CREATE_FILE_DEST, DB_CREATE_ONLINE_LOG_DEST_n, or DB_RECOVERY_FILE_DEST in your initialization parameter file, you instruct Oracle Database to create and manage the underlying operating system files of your database. Oracle Database will automatically create and manage the operating system files for the following database structures, depending on which initialization parameters you specify and how you specify clauses in your CREATE DATABASE statement:
通過在初始化參數(shù)文件中設(shè)置初始化參數(shù)DB_CREATE_FILE_DEST,DB_CREATE_ONLINE_LOG_DEST_n或DB_RECOVERY_FILE_DEST,可以指導(dǎo)Oracle數(shù)據(jù)庫創(chuàng)建和管理數(shù)據(jù)庫的底層操作系統(tǒng)文件。 Oracle數(shù)據(jù)庫將自動(dòng)創(chuàng)建和管理以下數(shù)據(jù)庫結(jié)構(gòu)的操作系統(tǒng)文件,具體取決于你指定的初始化參數(shù)以及在CREATE DATABASE語句中指定子句:
See Also:
"Specifying a Fast Recovery Area" for information about setting initialization parameters that create a Fast Recovery Area
The following CREATE DATABASE statement shows briefly how the Oracle Managed Files feature works, assuming you have specified required initialization parameters:
下面CREATE DATABASE語句簡要說明了Oracle托管文件功能的工作原理,假設(shè)您已經(jīng)指定了所需的初始化參數(shù):
CREATE DATABASE mynewdb
USER SYS IDENTIFIED BYsys_password
USER SYSTEM IDENTIFIED BYsystem_password
EXTENT MANAGEMENT LOCAL
UNDO TABLESPACE undotbs
DEFAULT TEMPORARY TABLESPACE tempts1
DEFAULT TABLESPACE users;
Supporting Bigfile Tablespaces During Database Creation
Oracle Database simplifies management of tablespaces and enables support for ultra-large databases by letting you create bigfile tablespaces. Bigfile tablespaces can contain only one file, but that file can have up to 4G blocks. The maximum number of datafiles in an Oracle Database is limited (usually to 64K files). Therefore, bigfile tablespaces can significantly enhance the storage capacity of an Oracle Database.
Oracle數(shù)據(jù)庫簡化了表空間的管理,并通過創(chuàng)建bigfile表空間來支持超大型數(shù)據(jù)庫。 Bigfile表空間只能包含一個(gè)數(shù)據(jù)文件,但該文件最多可以擁有4G的塊。 Oracle數(shù)據(jù)庫中的最大數(shù)據(jù)文件數(shù)量有限(通常為64K文件)。 因此,bigfile表空間可以顯著增強(qiáng)Oracle數(shù)據(jù)庫的存儲(chǔ)容量。
This section discusses the clauses of the CREATE DATABASE statement that let you include support for bigfile tablespaces.
See Also:
"Bigfile Tablespaces" for more
information about bigfile tablespaces
Specifying the Default Tablespace Type
The SET DEFAULT...TABLESPACE clause of the CREATE DATABASE statement determines the default type of tablespace for this database in subsequent CREATETABLESPACE statements. Specify either SET DEFAULT BIGFILE TABLESPACE or SET DEFAULT SMALLFILE TABLESPACE. If you omit this clause, then the default is asmallfile tablespace, which is the traditional type of Oracle Database tablespace. A smallfile tablespace can contain up to 1022 files with up to 4M blocks each.
CREATE DATABASE語句的SET DEFAULT ... TABLESPACE子句決定CREATE TABLESPACE語句中表空間的默認(rèn)類型。 指定SET DEFAULT BIGFILE TABLESPACE或SET DEFAULT SMALLFILE TABLESPACE。 如果省略此子句,那么默認(rèn)是一個(gè)smallfile表空間,它是傳統(tǒng)類型的Oracle數(shù)據(jù)庫表空間。 一個(gè)smallfile表空間最多可以包含1022個(gè)文件,最多可以有4M塊。
The use of bigfile tablespaces further enhances the Oracle Managed Files feature, because bigfile tablespaces make datafiles completely transparent for users. SQL syntax for the ALTER TABLESPACE statement has been extended to allow you to perform operations on tablespaces, rather than the underlying datafiles.
使用bigfile表空間進(jìn)一步增強(qiáng)了Oracle Managed Files功能,因?yàn)閎igfile表空間使數(shù)據(jù)文件對用戶完全透明。 已經(jīng)擴(kuò)展了ALTER TABLESPACE語句的SQL語法,允許對表空間執(zhí)行操作,而不是數(shù)據(jù)文件。
The CREATE DATABASE statement shown in "Specifying Oracle Managed Files at Database Creation" can be modified as follows to specify that the default type of tablespace is a bigfile tablespace:
“數(shù)據(jù)庫創(chuàng)建時(shí)指定Oracle托管文件”中CREATE DATABASE語句可以修改如下,以指定默認(rèn)類型的表空間是一個(gè)bigfile表空間:
CREATE DATABASE mynewdb
USER SYS IDENTIFIED BYsys_password
USER SYSTEM IDENTIFIED BYsystem_password
SET DEFAULT BIGFILE TABLESPACE
UNDO TABLESPACE undotbs
DEFAULT TEMPORARY TABLESPACE tempts1;
To dynamically change the default tablespace type after database creation, use the SET DEFAULT TABLESPACE clause of the ALTER DATABASE statement:
ALTER DATABASE SET DEFAULT BIGFILE TABLESPACE;
要在創(chuàng)建數(shù)據(jù)庫后動(dòng)態(tài)更改默認(rèn)表空間類型,請使用ALTER DATABASE語句的SET DEFAULT TABLESPACE子句:
You can determine the current default tablespace type for the database by querying the DATABASE_PROPERTIES data dictionary view as follows:
你可以通過查詢DATABASE_PROPERTIES數(shù)據(jù)字典視圖來確定數(shù)據(jù)庫的當(dāng)前缺省表空間類型,如下所示:
SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME = 'DEFAULT_TBS_TYPE';
Overriding the
Default Tablespace Type
The SYSTEM and SYSAUX tablespaces are always created with the default tablespace type. However, you can explicitly override the default tablespace type for theUNDO and DEFAULT TEMPORARY tablespace during the CREATE DATABASE operation.
SYSTEM和SYSAUX表空間始終使用默認(rèn)表空間類型創(chuàng)建。 但是,你可以在CREATE DATABASE時(shí)顯式覆蓋UNDO和DEFAULT TEMPORARY表空間的默認(rèn)表空間類型。
For example, you can create a bigfile UNDO tablespace in a database with the default tablespace type of smallfile as follows:
例如,你可以在數(shù)據(jù)庫中創(chuàng)建一個(gè)bigfile UNDO表空間,其默認(rèn)表空間類型為smallfile,如下所示:
CREATE DATABASE mynewdb
...
BIGFILE UNDO TABLESPACE undotbs
DATAFILE '/u01/oracle/oradata/mynewdb/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
You can create a smallfile DEFAULT TEMPORARY tablespace in a database with the default tablespace type of bigfile as follows:
CREATE DATABASE mynewdb
SET DEFAULT BIGFILE TABLESPACE
...
SMALLFILE DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/oracle/oradata/mynewdb/temp01.dbf'
SIZE 20M REUSE
...
Specifying the
Database Time Zone and Time Zone File
This section contains:
Setting the Database Time Zone
Set the database time zone when the database is created by using the SET TIME_ZONE clause of the CREATE DATABASE statement. If you do not set the database time zone, then it defaults to the time zone of the host operating system.
使用CREATE DATABASE語句的SET TIME_ZONE子句創(chuàng)建數(shù)據(jù)庫時(shí)設(shè)置數(shù)據(jù)庫時(shí)區(qū)。 如果不設(shè)置數(shù)據(jù)庫時(shí)區(qū),則默認(rèn)為主機(jī)操作系統(tǒng)的時(shí)區(qū)。
You can change the database time zone for a session by using the SET TIME_ZONE clause of the ALTER SESSION statement.
你可以使用ALTER SESSION語句的SET TIME_ZONE子句更改會(huì)話的數(shù)據(jù)庫時(shí)區(qū)。
See Also:
Oracle Database Globalization Support Guide for more information about setting the database time zone
About the
Database Time Zone Files
Two time zone files are included in a subdirectory of the Oracle home directory. The time zone files contain the valid time zone names. The following information is also included for each time zone:
兩個(gè)時(shí)區(qū)文件包含在Oracle主目錄的子目錄中。 時(shí)區(qū)文件包含有效的時(shí)區(qū)名稱。 每個(gè)時(shí)區(qū)也包括以下信息:
The default time zone file is ORACLE_HOME/oracore/zoneinfo/timezlrg_11.dat. A smaller time zone file with fewer time zones can be found inORACLE_HOME/oracore/zoneinfo/timezone_11.dat.
默認(rèn)時(shí)區(qū)文件為$ORACLE_HOME / oracore / zoneinfo / timezlrg_11.dat。 $ORACLE_HOME / oracore / zoneinfo / timezone_11.dat中可以找到較小時(shí)區(qū)文件。
要查看數(shù)據(jù)庫使用的文件中的時(shí)區(qū)名稱,請使用以下查詢
To view the time zone names in the file being used by your database, use the following query:
SELECT * FROM V$TIMEZONE_NAMES;
See Also:
Oracle Database Globalization Support
Guide for more information about managing and selecting time zone files
Specifying the Database Time Zone File
All databases that share information must use the same time zone datafile.
共享信息的所有數(shù)據(jù)庫必須使用相同的時(shí)區(qū)數(shù)據(jù)文件。
The database server always uses the large time zone file by default. If you would like to use the small time zone file on the client and know that all your data will refer only to regions in the small file, you can set the ORA_TZFILE environment variable on the client to the full path name of the timezone_version.dat file on the client, where version matches the time zone file version that is being used by the database server.
數(shù)據(jù)庫服務(wù)器默認(rèn)使用大時(shí)區(qū)文件。 如果在客戶端上要使用小時(shí)區(qū)文件,并且知道所有數(shù)據(jù)只能引用小文件中的區(qū)域,則可以將客戶端上的ORA_TZFILE環(huán)境變量設(shè)置為timezone_version.dat的完整路徑名,其中版本要與數(shù)據(jù)庫服務(wù)器正在使用的時(shí)區(qū)文件版本相匹配。
If you are already using the default larger time zone file on the client, then it is not practical to change to the smaller time zone file, because the database may contain data with time zones that are not part of the smaller file.
如果你已經(jīng)在客戶端上使用默認(rèn)較大的時(shí)區(qū)文件,那么更改為較小的時(shí)區(qū)文件是不切實(shí)際的,因?yàn)閿?shù)據(jù)庫可能包含不屬于較小文件的時(shí)區(qū)的數(shù)據(jù)。
Specifying FORCE
LOGGING Mode
Some data definition language statements (such as CREATE TABLE) allow the NOLOGGING clause, which causes some database operations not to generate redo records in the database redo log. The NOLOGGING setting can speed up operations that can be easily recovered outside of the database recovery mechanisms, but it can negatively affect media recovery and standby databases.
一些數(shù)據(jù)定義語言語句(例如CREATE TABLE)允許NOLOGGING子句,這導(dǎo)致一些數(shù)據(jù)庫操作不會(huì)在數(shù)據(jù)庫redo日志中生成重做記錄。 NOLOGGING設(shè)置可以加快在數(shù)據(jù)庫恢復(fù)機(jī)制之外輕松恢復(fù)的操作,但會(huì)對介質(zhì)恢復(fù)和備用數(shù)據(jù)庫產(chǎn)生負(fù)面影響。
Oracle Database lets you force the writing of redo records even when NOLOGGING has been specified in DDL statements. The database never generates redo records for temporary tablespaces and temporary segments, so forced logging has no affect for objects.
即使在DDL語句中指定了NOLOGGING,Oracle數(shù)據(jù)庫也可以強(qiáng)制寫入redo記錄。 數(shù)據(jù)庫從不為臨時(shí)表空間和臨時(shí)段生成重做記錄,因此強(qiáng)制日志對對象沒有影響。
See Also:
Oracle Database SQL Language Reference for
information about operations that can be done in NOLOGGING mode
Using the FORCE LOGGING Clause
To put the database into FORCE LOGGING mode, use the FORCE LOGGING clause in the CREATE DATABASE statement. If you do not specify this clause, the database is not placed into FORCE LOGGING mode.
要將數(shù)據(jù)庫置于FORCE LOGGING模式,請?jiān)贑REATE DATABASE語句中使用FORCE LOGGING子句。 如果不指定此子句,數(shù)據(jù)庫不會(huì)被置于FORCE LOGGING模式。
Use the ALTER DATABASE statement to place the database into FORCE LOGGING mode after database creation. This statement can take a considerable time for completion, because it waits for all unlogged direct writes to complete.
數(shù)據(jù)庫創(chuàng)建后,使用ALTER DATABASE語句將數(shù)據(jù)庫置于FORCE LOGGING模式。 此語句可能需要相當(dāng)長的時(shí)間來完成,因?yàn)樗却形磳懭氲膶懭氩拍芡瓿?/b>。
You can cancel FORCE LOGGING mode using the following SQL statement:
您可以使用以下SQL語句取消FORCE LOGGING模式:
ALTER DATABASE NO FORCE LOGGING;
Independent of specifying FORCE LOGGING for the database, you can selectively specify FORCE LOGGING or NO FORCE LOGGING at the tablespace level. However, ifFORCE LOGGING mode is in effect for the database, it takes precedence over the tablespace setting. If it is not in effect for the database, then the individual tablespace settings are enforced. Oracle recommends that either the entire database is placed into FORCE LOGGING mode, or individual tablespaces be placed into FORCE LOGGING mode, but not both.
獨(dú)立于數(shù)據(jù)庫來指定FORCE LOGGING,你可以在表空間級(jí)別選擇性地指定FORCE LOGGING或NO FORCE LOGGING。 但是,如果FORCE LOGGING模式對數(shù)據(jù)庫有效,則優(yōu)先于表空間設(shè)置。 如果數(shù)據(jù)庫不起作用,則會(huì)強(qiáng)制執(zhí)行各個(gè)表空間設(shè)置。 Oracle推薦將整個(gè)數(shù)據(jù)庫放入FORCE LOGGING模式,否則將各個(gè)表空間置于FORCE LOGGING模式中,但不能同時(shí)置入。
The FORCE LOGGING mode is a persistent attribute of the database. That is, if the database is shut down and restarted, it remains in the same logging mode. However, if you re-create the control file, the database is not restarted in the FORCE LOGGING mode unless you specify the FORCE LOGGING clause in the CREATE CONTROL FILE statement.
FORCE LOGGING模式是數(shù)據(jù)庫的持久屬性。 也就是說,如果數(shù)據(jù)庫被關(guān)閉并重新啟動(dòng),它將保持在相同的日志記錄模式。 但是,如果重新創(chuàng)建控制文件,除非在CREATE CONTROL FILE語句中指定了FORCE LOGGING子句,否則數(shù)據(jù)庫不會(huì)在FORCE LOGGING模式下重新啟動(dòng)。
See Also:
"Controlling the Writing of Redo Records" for information about using the FORCE LOGGING clause for tablespace creation.
Performance
Considerations of FORCE LOGGING Mode
FORCE LOGGING mode results in some performance degradation. If the primary reason for specifying FORCE LOGGING is to ensure complete media recovery, and there is no standby database active, then consider the following:
FORCE LOGGING模式導(dǎo)致性能下降。 如果指定FORCE LOGGING的主要原因是確保完整的介質(zhì)恢復(fù),并且沒有備用數(shù)據(jù)庫處于活動(dòng)狀態(tài),那么請考慮以下幾點(diǎn):
· 多少媒體故障可能會(huì)發(fā)生?
· 直接寫入無法恢復(fù)時(shí),損壞程度如何?
· 強(qiáng)制記錄是否容忍性能下降?
If the database is running in NOARCHIVELOG mode, then generally there is no benefit to placing the database in FORCE LOGGING mode. Media recovery is not possible in NOARCHIVELOG mode, so if you combine it with FORCE LOGGING, the result may be performance degradation with little benefit.
如果數(shù)據(jù)庫以NOARCHIVELOG模式運(yùn)行,那么一般來說,將數(shù)據(jù)庫置于FORCE LOGGING模式下通常沒有任何好處。 在NOARCHIVELOG模式下,介質(zhì)恢復(fù)是不可能的,因此如果將其與強(qiáng)制登錄結(jié)合使用,結(jié)果可能會(huì)降低性能,而且效果不大。
作者:SEian.G(苦練七十二變,笑對八十一難)
網(wǎng)站欄目:【翻譯】SpecifyingCREATEDATABASEStatementClauses
分享URL:http://jinyejixie.com/article30/ghdsso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、網(wǎng)站排名、域名注冊、微信小程序、定制網(wǎng)站、做網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)