建多個資料庫
⑴ sql Server中一個資料庫中有多個資料庫文件是什麼意思怎麼創建多個資料庫文件文件組又是什麼意思
SQL Server中一個資料庫可以對應多個物理文件,其中有一個的主資料庫文件,擴展名為MDF,其他為次資料庫文件,擴展名為NDF。可以將不同的文件存放在不同的驅動器上,可以提高數據訪問速度。
文件組是邏輯概念,主要目的是將文件分組管理。
create database db3
on
primary                      --主文件組
(name='db3_dat1',    --資料庫主文件
filename='d:\db3_dat1.mdf',
size=10mb,
maxsize=100mb,
filegrowth=10%
),
(name='db2_dat2',        --主文件組,是次資料庫文件
filename='d:\db2_dat2.ndf',
size=10mb,
maxsize=100mb,
filegrowth=10%
),
filegroup db3g1   --第2個文件組
(name='db3_dat3',  --第2個文件組中的次資料庫
filename='d:\db2_dat3.ndf',
size=10mb,
maxsize=30mb,
filegrowth=5mb
),
(name='db3_dat4',   --第2個文件組中的次資料庫
filename='d:\db2_dat4.ndf',
size=5mb,
maxsize=30mb,
filegrowth=5mb
),
filegroup db3g2  --第三個文件組
(name='db3_dat5',  ----第三個文件組中的次資料庫
filename='d:\db2_dat5.ndf',
size=10mb,
maxsize=50mb,
filegrowth=20%
)
log on
(name='db3_log',          --日誌文件
filename='d:\db3_log.ldf',
size=20mb,
maxsize=100mb,
filegrowth=10mb
)
⑵ 怎樣再oracle中建立多個資料庫
通過oracle自帶的DBCA建資料庫。
⑶ 新手一個MYSQL平台下可以建多個資料庫嗎
一個系統可以裝多個mysql實例,只要將埠號改一下就好了。例如一個監聽3306,一個監聽3307。
如果是建多個庫的話,可以用語句create
database
XXX
⑷ oracle可以創建多個資料庫嗎
不管你是什麼操作系統,可以按照下列的方式創建多個Oracle資料庫點擊[開始]->[程序]->[Oracle - OraHome92]->[Configuration and Migration Tools]->[Database Configuration Assistant],然後按照中文提示創建自己的資料庫!!
Oracle和SQL不一樣,可以說是復雜的多,用慣了SQL的朋友真的是很難接受Oracle的操作方式,
⑸ oracle 一個實例下可以建多個資料庫么
oracle 一個實例下可以建多個資料庫么?
:一 通常情況下:一個實例對應一個資料庫 二 RAC集群:多個實例對應一個資料庫 三oracle12C:一個實例可以對應多個資料庫
⑹ 一個mysql伺服器建了多個資料庫和只建一個資料庫有區別嗎
二個以上的網站共同使用一個MYSQL資料庫,這種方式可以是的,在建站實踐中可以執行,而且很多站長也是採用這種方式建過站。我們只需要保障每個網站的「MYSQL資料庫前綴名稱」不一樣就可以了。
多網站共享一個mysql資料庫,不會影響網站正常運行。非要說個影響的理由,個人認為就是資料庫表查詢的速度和安全有所下降,但是在我們的訪問使用,這個這種速度的差異,無法感覺到的。
多網站共享一個mysql資料庫,站長們最關心的應該就是mysql管理備份的問題。多網站共享一個資料庫後,極大方便了我們對資料庫備份操作,只需要備份一個資料庫即可,不用頻繁登錄切換。
⑺ oracle10G怎麼里怎麼創建多個資料庫
一個資料庫創建多個實例
    1.      先要關閉資料庫(進程和內存關閉)
    [Oracle@oracle_2 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 20:34:53 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release10.2.0.1.0 - Proction
    With the Partitioning, OLAP and Data Mining options
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> exit
    2.      設置環境變數
    [oracle@oracle_2 ~]$ vi .bash_profile
    此時環境變數已經設置好了
    3.      創建目錄
    i.             創建相關文件
    此時我們可以看見已經有了相關目錄,那是我們之前創建的實例ORCL的相關目錄
    創建目錄是採用了批量創建目錄{a,b,c,u}mp
    [oracle@oracle_2 ~]$ cd $ORACLE_BASE
    [oracle@oracle_2 oracle]$ ls
    admin flash_recovery_area  oradata  oraInventory proct
    [oracle@oracle_2 oracle]$
    [oracle@oracle_2 oracle]$ mkdir -p admin/ORA10G/{a,b,c,u}mp
    [oracle@oracle_2 oracle]$ ls
    admin flash_recovery_area  oradata  oraInventory proct
    [oracle@oracle_2 oracle]$ cd admin/
    [oracle@oracle_2 admin]$ ls
    ORA10G  ORCL
    [oracle@oracle_2 admin]$ cd ORA10G/
    [oracle@oracle_2 ORA10G]$ ls
    amp bmp  cmp  ump
    [oracle@oracle_2 ORA10G]$
    [oracle@oracle_2 ORA10G]$ ls
    amp bmp  cmp  ump
    [oracle@oracle_2 ORA10G]$ cd ..
    [oracle@oracle_2 admin]$ ls
    ORA10G  ORCL
    [oracle@oracle_2 admin]$ cd ..
    [oracle@oracle_2 oracle]$ ls
    admin flash_recovery_area  oradata  oraInventory proct
    [oracle@oracle_2 oracle]$ mkdir -p oradata/ORA10G
    [oracle@oracle_2 oracle]$
    ii.             創建密碼文件
    創建密碼文件需要到ORACLE_HOME/dbs目錄下創建
    [oracle@oracle_2 10.2.0]$ cd $ORACLE_HOME/dbs
    [oracle@oracle_2 dbs]$ ls
    hc_ORCL.dat initdw.ora  init.ora  lkORCL orapwORCL  spfileORCL.ora
    [oracle@oracle_2 dbs]$ orapwd
    Usage: orapwd file=<fname>password=<password> entries=<users> force=<y/n>
    where
    file -name of password file (mand),
    password- password for SYS (mand),
    entries -maximum number of distinct DBA and    force - whether to overwrite existing file (opt),
    OPERs (opt),
    There areno spaces around the equal-to (=) character.
    [oracle@oracle_2 dbs]$ orapwd file=orapwORA10Gpassword=oracle entries=30
    [oracle@oracle_2 dbs]$ ls
    hc_ORCL.dat init.ora  orapwORA10G  spfileORCL.ora
    initdw.ora  lkORCL    orapwORCL
    [oracle@oracle_2 dbs]$
    [oracle@oracle_2 dbs]$ cat init.ora |grep -v^#|grep -v ^$ >initORA10G.ora
    [oracle@oracle_2 dbs]$ ls
    hc_ORCL.dat init.ora        lkORCL       orapwORCL
    initdw.ora  initORA10G.ora  orapwORA10G  spfileORCL.ora
    [oracle@oracle_2 dbs]$
    [oracle@oracle_2 dbs]$ vi initORA10G.ora
    將內容改的和下面的一樣
    db_name=ORA10G
    db_files = 80                                                        # SMALL
    db_file_multiblock_read_count = 8                                     #SMALL
    log_checkpoint_interval = 10000
    processes = 50                                                        # SMALL
    parallel_max_servers = 5                                              #SMALL
    log_buffer = 32768                                                   # SMALL
    max_mp_file_size = 10240      # limit trace file size to 5 Meg each
    global_names = false
    control_files =(/u01/app/oracle/oradata/ORA10G/ora_control1.ctl,/u01/app/oracle/oradata/ORA10G/ora_control2.ctl)
    sga_max_size=300m
    sga_target=300m
    4.      啟動實例為ORA10G的資料庫
    [oracle@oracle_2 dbs]$ export $ORACLE_SID=ORA10G
    [oracle@oracle_2 dbs]$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 21:08:55 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to an idle instance.
    SYS@ORA10G>
    SYS@ORA10G>create spfile from pfile;
    File created.
    SYS@ORA10G>startup nomount;
    ORACLE instance started.
    Total System Global Area  314572800 bytes
    Fixed Size                  1219184 bytes
    Variable Size              96470416 bytes
    Database Buffers          213909504 bytes
    Redo Buffers                2973696 bytes
    SYS@ORA10G>
    SYS@ORA10G>show parameter undo
    NAME                                 TYPE        VALUE
    ------------------------------------ -----------------------------------------
    undo_management                      string      MANUAL
    undo_retention                       integer     900
    undo_tablespace                      string
    SYS@ORA10G>
    修改參數,由於undo_management參數為靜態參數,所以需要加上scope=spfile
    SYS@ORA10G>alter system set undo_management=autoscope=spfile;
    System altered.
    SYS@ORA10G>show parameter undo
    NAME                                 TYPE        VALUE
    ------------------------------------ -----------------------------------------
    undo_management                      string      MANUAL
    undo_retention                       integer     900
    undo_tablespace                      string
    SYS@ORA10G>shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.
    此時發現並沒有更改,是由於靜態參數需要重啟才有效
    SYS@ORA10G>startup nomount;
    ORACLE instance started.
    Total System Global Area  314572800 bytes
    Fixed Size                  1219184 bytes
    Variable Size              96470416 bytes
    Database Buffers          213909504 bytes
    Redo Buffers                2973696 bytes
    SYS@ORA10G>
    此時只是改了spfile的參數還需要改pfile的參數
    SYS@ORA10G>create pfile from spfile;
    File created.
    SYS@ORA10G>
    5.      多個實例的切換
    i.             實例為ORCL啟動資料庫
    [oracle@oracle_2 dbs]$ export ORACLE_SID=ORCL
    [oracle@oracle_2 dbs]$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 21:19:19 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to an idle instance.
    SYS@ORCL>
    ii.             實例為ORCL10G啟動資料庫
    SYS@ORCL>exit
    Disconnected
    [oracle@oracle_2 dbs]$ export ORACLE_SID=ORA10G
    [oracle@oracle_2 dbs]$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 21:24:54 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release10.2.0.1.0 - Proction
    With the Partitioning, OLAP and Data Mining options
    SYS@ORA10G>
