设为首页 收藏本站
查看: 1201|回复: 0

[经验分享] OCM_Session1_5_Tablespace Creation and Configurationnote

[复制链接]

尚未签到

发表于 2015-11-9 12:06:44 | 显示全部楼层 |阅读模式
5. Tablespace Creation and Configurationnote: Tablespaces must be named as specified in each task to receive credit.

  • 5.1 Create a temporary tablespace group that contains two(2) temporary tablespaces to support batch processing, the creation of large indexes,and analyzing tables, Use the followingspecifications:
  •   5.1.1 Temporary tablespace group named TEMP_GRP containing temporary tablespaces TEMP1 and TEMP2.
  •   5.1.2 Make TEMP_GRP the default temporary tablespace for all new users.

5.1 Create a temporary tablespace group that contains two(2) temporary tablespaces to support batch processing, the creation of large indexes,and analyzing tables, Use the following specifications:  5.1.1 Temporary tablespace group named TEMP_GRP containing temporary tablespaces TEMP1 and TEMP2.  5.1.2 Make TEMP_GRP the default temporary tablespace for all new users.5.1创建临时表空间组,包含2个临时表空间来支持批处理,大的索引创建,表的分析,按照以下的说明来创建:5.1.1 临时表空间组的名称叫TEMP_GRP,包含TEMP1,TEMP2这两个临时表空间。5.1.2 让TEMP_GRP作为新用户的默认临时表空间。
参考联机文档:Administrator's Guide ==> Managing Tablespaces==>Creating a Locally Managed Temporary Tablespacehttp://docs.oracle.com/cd/B19306_01/server.102/b14231/tspaces.htm#i1013552
参照:Changing Members of a Tablespace Group
You can add a tablespace to an existing tablespace group by specifying the existing group name in the TABLESPACE GROUP clause of the CREATE TEMPORARYTABLESPACE or ALTER TABLESPACE statement.
The following statement adds a tablespace to an existing group. It creates and adds tablespace lmtemp3 to group1, so that group1 containstablespaces lmtemp2and lmtemp3.
CREATE TEMPORARY TABLESPACE lmtemp3 TEMPFILE '/u02/oracle/data/lmtemp301.dbf'     SIZE 25M     TABLESPACE GROUP group1; The following statement also adds a tablespace to an existing group, but in this case because tablespace lmtemp2 already belongs to group1,it is in effect moved from group1 to group2:
ALTER TABLESPACE lmtemp2 TABLESPACE GROUP group2; Now group2 contains both lmtemp and lmtemp2, while group1 consistsof only tmtemp3.
You can remove a tablespace from a group as shown in the following statement:
ALTER TABLESPACE lmtemp3 TABLESPACE GROUP ''; Tablespace lmtemp3 no longer belongs to any group. Further, since there are no longer any members of group1, this results in the implicitdeletion of group1.
Assigning a Tablespace Group as the Default Temporary Tablespace
Use the ALTER DATABASE...DEFAULT TEMPORARY TABLESPACE statement to assign a tablespace group as the defaulttemporary tablespace for the database. For example:
ALTER DATABASE sample DEFAULT TEMPORARY TABLESPACE group2;


首先添加两个临时表空间TMEP1和TEMP2到临时表空间组TEMP_GRP组然后再让临时表空间组TEMP_GRP更改为默认的临时表空间
操作如下:
SQL> select * from DATABASE_PROPERTIES;
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------DICT.BASE                      2                                                  dictionary base tables version #DEFAULT_TEMP_TABLESPACE        TEMPTS1                                           Name of default temporary tablespaceDEFAULT_PERMANENT_TABLESPACE   SYSTEM                                             Name of default permanent tablespaceDBTIMEZONE                     +08:00                                             DB time zoneDEFAULT_TBS_TYPE               SMALLFILE                                          Default tablespace typeNLS_LANGUAGE                   AMERICAN                                           LanguageNLS_TERRITORY                  AMERICA                                            TerritoryNLS_CURRENCY                   $                                                  Local currencyNLS_ISO_CURRENCY               AMERICA                                            ISO currencyNLS_NUMERIC_CHARACTERS         .,                                                 Numeric charactersNLS_CHARACTERSET               AL32UTF8                                           Character set
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------NLS_CALENDAR                   GREGORIAN                                          Calendar systemNLS_DATE_FORMAT                DD-MON-RR                                          Date formatNLS_DATE_LANGUAGE              AMERICAN                                           Date languageNLS_SORT                       BINARY                                             Linguistic definitionNLS_TIME_FORMAT                HH.MI.SSXFF AM                                     Time formatNLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM                           Time stamp formatNLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR                                 Time with timezone formatNLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR                       Timestamp with timezone formatNLS_DUAL_CURRENCY              $                                                  Dual currency symbolNLS_COMP                       BINARY                                             NLS comparisonNLS_LENGTH_SEMANTICS           BYTE                                               NLS length semantics
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------NLS_NCHAR_CONV_EXCP            FALSE                                              NLS conversion exceptionNLS_NCHAR_CHARACTERSET         AL16UTF16                                          NCHAR Character setNLS_RDBMS_VERSION              10.2.0.1.0                                         RDBMS version for NLS parametersGLOBAL_DB_NAME                 PROD                                               Global database nameEXPORT_VIEWS_VERSION           8                                                  Export views revision #
27 rows selected.
SQL> select name from v$tablespace;
NAME------------------------------SYSTEMUNDOTBS1SYSAUXTEMPTS1

SQL> create temporary tablespace temp1 tempfile '/u01/app/oracle/oradata/PROD/Disk1/temp11.dbf'size 20m  2  tablespace group temp_grp;
Tablespace created.
SQL> create temporary tablespace temp2 tempfile '/u01/app/oracle/oradata/PROD/Disk1/temp12.dbf'size 20m  2  tablespace group temp_grp;
Tablespace created.
SQL> alter database default temporary tablespace temp_grp;
Database altered.
SQL> select name from v$tablespace;
NAME------------------------------SYSTEMUNDOTBS1SYSAUXTEMPTS1TEMP1TEMP2
6 rows selected.
SQL> select * from DATABASE_PROPERTIES;
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------DICT.BASE                      2                                                  dictionary base tables version #DEFAULT_TEMP_TABLESPACE        TEMP_GRP                                          Name of default temporary tablespaceDEFAULT_PERMANENT_TABLESPACE   SYSTEM                                             Name of default permanent tablespaceDBTIMEZONE                     +08:00                                             DB time zoneDEFAULT_TBS_TYPE               SMALLFILE                                          Default tablespace typeNLS_LANGUAGE                   AMERICAN                                           LanguageNLS_TERRITORY                  AMERICA                                            TerritoryNLS_CURRENCY                   $                                                  Local currencyNLS_ISO_CURRENCY               AMERICA                                            ISO currencyNLS_NUMERIC_CHARACTERS         .,                                                 Numeric charactersNLS_CHARACTERSET               AL32UTF8                                           Character set
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------NLS_CALENDAR                   GREGORIAN                                          Calendar systemNLS_DATE_FORMAT                DD-MON-RR                                          Date formatNLS_DATE_LANGUAGE              AMERICAN                                           Date languageNLS_SORT                       BINARY                                             Linguistic definitionNLS_TIME_FORMAT                HH.MI.SSXFF AM                                     Time formatNLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM                           Time stamp formatNLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR                                 Time with timezone formatNLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR                       Timestamp with timezone formatNLS_DUAL_CURRENCY              $                                                  Dual currency symbolNLS_COMP                       BINARY                                             NLS comparisonNLS_LENGTH_SEMANTICS           BYTE                                               NLS length semantics
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------NLS_NCHAR_CONV_EXCP            FALSE                                              NLS conversion exceptionNLS_NCHAR_CHARACTERSET         AL16UTF16                                          NCHAR Character setNLS_RDBMS_VERSION              10.2.0.1.0                                         RDBMS version for NLS parametersGLOBAL_DB_NAME                 PROD                                               Global database nameEXPORT_VIEWS_VERSION           8                                                  Export views revision #
27 rows selected.
SQL>




  • 5.2 Create a permanent tablespace to store sample test data. Use the following specifications:
  •   5.2.1 Tablespace name of EXAMPLE
  •   5.2.2 Initial datafile size of 400MB with the file expectd to grow to 4TB.
  •   5.2.3 Initial extent size of 1MB
  •   5.2.4 next extent size of 1MB

参考联机文档:Administrator's Guide ==> Managing Tablespaces==>Creating a Bigfile Tablespacehttp://docs.oracle.com/cd/B19306_01/server.102/b14231/tspaces.htm#i1010733
Creating a Bigfile Tablespace
To create a bigfile tablespace, specify the BIGFILE keyword of the CREATE TABLESPACE statement(CREATE BIGFILE TABLESPACE ...). Oracle Database automatically creates a locally managed tablespace with automatic segment space management. You can,but need not, specify EXTENT MANAGEMENT LOCAL and SEGMENT SPACEMANAGEMENT AUTO inthis statement. However, the database returns an error if you specify EXTENT MANAGEMENT DICTIONARY or SEGMENT SPACE MANAGEMENT MANUAL.The remaining syntax of the statement is the same as for the CREATE TABLESPACE statement, but you can only specify one datafile. For example:
CREATE BIGFILE TABLESPACE bigtbs    DATAFILE '/u02/oracle/data/bigtbs01.dbf' SIZE 50G... You can specify SIZE in kilobytes (K), megabytes (M), gigabytes (G), or terabytes (T).
If the default tablespace type was set to BIGFILE at database creation, you need not specify the keyword BIGFILE in the CREATE TABLESPACE statement.A bigfile tablespace is created by default.
If the default tablespace type was set to BIGFILE at database creation, but you want to create a traditional (smallfile) tablespace, then specify a CREATESMALLFILE TABLESPACE statementto override the default tablespace type for the tablespace that you are creating.
操作如下:
SQL> create bigfile tablespace example datafile'/u01/app/oracle/oradata/PROD/Disk1/example01.dbf' size 400m  2  autoextend on next 1m maxsize 4t extent management local uniform size 1m;
Tablespace created.




  • 5.3 Create a permanent tablespace to store indexes, Use the following specifications:
  •   5.3.1 Tablespace name of INDX
  •   5.3.2 File size of 40MB

参考联机文档:Administrator's Guide ==> Managing Tablespaces==>Creating a Locally Managed Tablespace
操作如下:
SQL> create tablespace indx datafile '/u01/app/oracle/oradata/PROD/Disk1/indx01.dbf' size 40m;
Tablespace created.




  • 5.4 Create a permanent tablespace to store data collected from various Oracle tools. Use the following specifications:
  •   5.4.1 Tablespace name of TOOLS
  •   5.4.2 File size of 10MB
操作如下:
SQL> create tablespace tools datafile '/u01/app/oracle/oradata/PROD/Disk1/tools01.dbf' size 10m;
Tablespace created.





  • 5.5 Create a default permanent tablespace using the following specifications:
  •   5.5.1 Tablespace name of USERS
  •   5.5.2 File size of 48MB
  •   5.5.3 Initial extent size of 4MB
  •   5.5.4 Next extent size of 4MB
操作如下:
SQL> create tablespace users datafile '/u01/app/oracle/oradata/PROD/Disk1/users01.dbf' size 48m  2  extent management local uniform size 4m;
Tablespace created.
SQL> alter database default tablespace users;
Database altered.

SQL> select * from DATABASE_PROPERTIES;
PROPERTY_NAME                  PROPERTY_VALUE                                     DESCRIPTION------------------------------ -------------------------------------------------- --------------------------------------------------DICT.BASE                      2                                                  dictionary base tables version #DEFAULT_TEMP_TABLESPACE        TEMP_GRP                                           Name of default temporary tablespaceDEFAULT_PERMANENT_TABLESPACE   USERS                                              Name of default permanent tablespaceDBTIMEZONE                     +08:00            ...



  • 5.6 Create a permanent tablespace for storing segments associated with online transaction processing with high insert rates. Due to the potential high volume of concurrent inserts,every effort should be taken to reduce contention for each of the tables that will be stored in this tablespace. Use the following specifications:
  •   5.6.1 Tablespace name of OLTP
  •   5.6.2 File size of 48MB
  •   5.6.3 Initial extent size of 2MB
  •   5.6.4 Next extent size of 2MB

(ASSM)
操作如下:
SQL> create tablespace oltp datafile '/u01/app/oracle/oradata/PROD/Disk1/oltp01.dbf' size 48m  2  extent management local uniform size 2m segment space management auto;
Tablespace created.
         版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-137005-1-1.html 上篇帖子: OCM_session0手动建库实验 下篇帖子: ORA-06512: at "ORACLE_OCM.MGMT_DB_LL_METRICS"
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表