`
hai0378
  • 浏览: 532165 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Use a Script to Create a DB2 Database

 
阅读更多

 
Use a Script to Create a DB2 Database

When you use a DB2 database with vCenter Server, the database must have certain buffer pools, table spaces, and privileges. To simplify the process of creating the database, you can run a DB2 script.

Configure an IBM DB2 database user and group.

Add the database instance registry variables.

Add the client instance registry variable.

1

Copy the following DB2 script into a text editor and save it with a descriptive filename, such as vcdbcreate.sql.

The script is located in the /<installation directory>/vpx/dbschema/db2_prereq_connection_configuration.txt vCenter Server installation package file.

CREATE DATABASE VCDB 
AUTOMATIC STORAGE YES ON 'C:\' 
DBPATH ON 'C:\' USING CODESET UTF-8 
TERRITORY US 
COLLATE USING SYSTEM PAGESIZE 4096;

UPDATE DB CFG FOR VCDB USING AUTO_MAINT ON;
UPDATE DB CFG FOR VCDB USING AUTO_TBL_MAINT ON;
UPDATE DB CFG FOR VCDB USING AUTO_RUNSTATS ON;
UPDATE DB CFG FOR VCDB USING logprimary 32 logsecond 6 logfilsiz 2048;
UPDATE ALERT CFG FOR DATABASE ON VCDB USING db.db_backup_req SET THRESHOLDSCHECKED YES;
UPDATE ALERT CFG FOR DATABASE ON VCDB USING db.tb_reorg_req SET THRESHOLDSCHECKED YES;
UPDATE ALERT CFG FOR DATABASE ON VCDB USING db.tb_runstats_req SET THRESHOLDSCHECKED YES;

CONNECT TO VCDB;
grant select on sysibmadm.applications to user vcx;
CREATE BUFFERPOOL VCBP_8K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 8K;
CREATE LARGE TABLESPACE VCTS_8k PAGESIZE 8K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 32 OVERHEAD 12.67 PREFETCHSIZE 32 TRANSFERRATE 0.18 BUFFERPOOL VCBP_8K;
CREATE BUFFERPOOL VCBP_16K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 16K;
CREATE LARGE TABLESPACE VCTS_16k PAGESIZE 16K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 32 OVERHEAD 12.67 PREFETCHSIZE 32 TRANSFERRATE 0.18 BUFFERPOOL VCBP_16K;
CREATE BUFFERPOOL VCBP_32K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 32K;
CREATE LARGE TABLESPACE VCTS_32k PAGESIZE 32K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 32 OVERHEAD 12.67 PREFETCHSIZE 32 TRANSFERRATE 0.18 BUFFERPOOL VCBP_32K;
CREATE TABLESPACE SYSTOOLSPACE IN IBMCATGROUP MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 4;
CREATE USER TEMPORARY TABLESPACE SYSTOOLSTMPSPACE IN IBMCATGROUP MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 4;
CREATE SYSTEM TEMPORARY TABLESPACE VCTEMPTS_8K PAGESIZE 8K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL VCBP_8K;
CREATE SYSTEM TEMPORARY TABLESPACE VCTEMPTS_16K PAGESIZE 16K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL VCBP_16K;
CREATE SYSTEM TEMPORARY TABLESPACE VCTEMPTS_32K PAGESIZE 32K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL VCBP_32K;

GRANT USE OF TABLESPACE VCTS_16K TO USER vcx WITH GRANT OPTION;
GRANT USE OF TABLESPACE VCTS_32K TO USER vcx WITH GRANT OPTION;
GRANT USE OF TABLESPACE VCTS_8K TO USER vcx WITH GRANT OPTION;

commit work;
connect reset; 
terminate;
2

Customize the following values in the script.

Database name: VCDB. You must use the same value for the ODBC setup.

Database path: C:\ for Microsoft Windows, or a UNIX path with sufficient permissions.

User name: vcx. You must use the same value for the ODBC setup.

Do not modify the script in any other way. Changing the setup for table spaces or buffer pools might prevent successful installation of vCenter Server.

3

Run the script in a DB2 Command window.

db2 -svtf vcdbcreate.sql

You now have a DB2 database that you can use with vCenter Server.

Configure a connection to a local or remote database.

分享到:
评论

相关推荐

    (DB2官方手册:调用级别接口(CLI)指南和引用2/2)DB2DevCLIVol2-db2l2e1051.pdf

    describes how to use CLI to create database applications for DB2® for Linux, UNIX, and Windows. Volume 2 is a reference that describes CLI functions, keywords and configuration. The Call Level ...

    DB2 v11.1 DBA Certification Study Guide 2018 pdf

    Create, manage, and alter Db2 database objects Use the partitioning capabilities available within Db2 Enforce constraint checking with the SET INTEGRITY command Utilize the Db2 problem determination ...

    db2命令大全,db2命令大全

    CREATE TABLESPACE exoatbs IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 8K MANAGED BY SYSTEM USING ('/home/exoa2/exoacontainer') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K OVERHEAD ...

    IBM db2 常用命令大全

    `CREATE TABLESPACE exoatbs IN DATABASE PARTITION GROUP Ibmdefaultgroup PAGESIZE 8K MANAGED BY SYSTEM USING('/home/exoa2/exoacontainer') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL ibmdefault8k OVERHEAD ...

    Db2数据库操作的常用命令列表

    GRANT USE OF TABLESPACE exoatbs TO PUBLIC; 其中,exoatbs是表空间的名称,TO PUBLIC表示授予的对象是公共用户。 创建系统表空间: 系统表空间是Db2数据库中用于存储系统数据的表空间。创建系统表空间可以使用...

    db2的备份和恢复.

    6. **创建临时表空间**:`create temporary tablespace temp pagesize 32k managed by database using (file '/home/db2inst1/rdl/data' 5000) extentsize 80 bufferpool testpool`定义了一个名为`temp`的临时表空间...

    db2命令行大全(全)

    - `GRANT CREATE TAB, CONNECT ON DATABASE TO USER FUJIE`:授予用户FUJIE创建表和连接数据库的权限。 - `GRANT SELECT, UPDATE, DELETE ON TABLE EMPLOYEE TO USER JOHN WITH GRANT OPTION`:授权JOHN对EMPLOYEE表...

    DB2命令总汇 txt格式

    `GRANT CREATE TAB, CONNECT ON DATABASE TO USER FUJIE;` 将创建表和连接到数据库的权限授予用户`FUJIE`。 - **示例** `grant select, update, delete on table employee to user john with grant option;` ...

    db2数据库文档

    CREATE TABLESPACE exoatbs IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 8K MANAGED BY SYSTEM USING ('/home/exoa2/exoacontainer') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K OVERHEAD ...

    Laravel开发-laravel-db2

    'database' =&gt; env('DB2_DATABASE', 'your_database_name'), 'username' =&gt; env('DB2_USERNAME', 'your_username'), 'password' =&gt; env('DB2_PASSWORD', 'your_password'), 'charset' =&gt; 'UTF-8', 'collation' ...

    DB2 命令,DB2命令大全

    CREATETEMPORARY TABLESPACE exoasystmp IN DATABASE PARTITION GROUP IBMTEMPGROUP PAGESIZE 8K MANAGED BY SYSTEM USING('/home/exoa2/exoasystmp') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K ...

    DB2SQL命令大全

    CREATE TABLESPACE EXOATBS IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 8K MANAGED BY SYSTEM USING('/home/exoa2/exoacontainer') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K OVERHEAD ...

    DB2命令总汇

    - 示例:`GRANT CREATE TAB, CONNECT ON DATABASE TO USER FUJIE;` - 示例:`GRANT SELECT, UPDATE, DELETE ON TABLE EMPLOYEE TO USER JOHN WITH GRANT OPTION;` #### 四、数据库参数设置 - **db2set**: 设置或...

    Arcsde 9.3 db2 安装简单图解

    CREATE DATABASE arcsde USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM USERTABLESPACE MANAGED BY DATABASE USING (FILE 'd:\db2\arcsde\sde.tbsp' 51200) EXTENTSIZE 16 PREFETCHSIZE 16 OVERHEAD 24.1...

    Db2_SQL命令大全(完整版)

    CREATE TABLESPACE [表空间名] IN DATABASE PARTITION GROUP [分区组名] PAGESIZE [页面大小] MANAGED BY SYSTEM USING (['物理路径']) EXTENTSIZE [扩展单元大小] PREFETCHSIZE [预读大小] BUFFERPOOL [缓冲池名] ...

    DB2数据库搭建记录(AIX).

    GRANT USE OF TABLESPACE DZHT_L_SPACE TO USER yy_sc; GRANT USE OF TABLESPACE DZHT_L_SPACE TO USER yy_sg; ``` 通过以上步骤,可以完成DB2数据库在AIX系统上的基本搭建,并解决了在创建表空间过程中遇到的...

    超全DB2SQL命令大全

    CREATE TABLESPACE exoatbs IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 8K MANAGED BY SYSTEM USING ('/home/exoa2/exoacontainer') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K OVERHEAD ...

    db2使用大全

    CREATE TABLESPACE exoatbs IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 8K MANAGED BY SYSTEM USING ('/home/exoa2/exoacontainer') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K OVERHEAD ...

    DB2命令大全

    **DB2**(Database 2)是IBM开发的一款关系型数据库管理系统,广泛应用于企业和组织的数据管理之中。DB2提供了强大的数据处理能力,并且支持多种操作系统平台。 ### DB2命令概述 #### 连接到DB2数据库 - **`...

    db2常用命令和常见的错误处理

    - **示例**: `db2 connect to mydb user db2admin using password` #### 2. 创建缓存池(Buffer Pool) - **命令格式**: - `CREATE BUFFERPOOL [缓存池名称] IMMEDIATE SIZE [大小] PAGESIZE [页大小]` - **功能**: ...

Global site tag (gtag.js) - Google Analytics