[20140928]数据库建立在内存中.txt
--单位正好到了几台新机器,内存128G.
--测试一下dbca slient建立数据库,因为完成后可以丢弃,把数据库建立在内存中.
# mkdir -p /mnt/ramdisk
# mount -t tmpfs -o size=8G tmpfs /mnt/ramdisk
# su - oracle
--检查环境变量是否设置正确
$ env | grep -i oracle
USER=oracle
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:/u01/app/oracle/product/11.2.0/db_1/oracm/lib:/lib:/usr/lib:/usr/local/lib:/lib64:/usr/lib64:/usr/local/lib64
ORACLE_BASE=/u01/app/oracle
PATH=.:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/NX/bin:/home/oracle/bin:/home/oracle/bin:/u01/app/oracle/product/11.2.0/db_1/bin
HOME=/home/oracle
LOGNAME=oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
$ echo $NLS_LANG
AMERICAN_AMERICA.zhs16gbk
$ export ORACLE_SID=
$ORACLE_HOME/bin/dbca -createDatabase -templateName General_Purpose.dbc -gdbName test -sid test -sysPassword oracle \
-systemPassword oracle -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -listeners LISTENER -sampleSchema true -totalMemory 800 \
-databaseType MULTIPURPOSE -silent -datafileDestination /mnt/ramdisk
$ export ORACLE_SID=test
$ rlsql
SQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 28 17:03:19 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show sga
Total System Global Area 626327552 bytes
Fixed Size 2230952 bytes
Variable Size 184550744 bytes
Database Buffers 432013312 bytes
Redo Buffers 7532544 bytes
SQL> host ls -l /mnt/ramdisk/test/
total 1796032
-rw-r----- 1 oracle oinstall 9748480 Sep 28 17:03 control01.ctl
-rw-r----- 1 oracle oinstall 328343552 Sep 28 17:02 example01.dbf
-rw-r----- 1 oracle oinstall 52429312 Sep 28 17:02 redo01.log
-rw-r----- 1 oracle oinstall 52429312 Sep 28 17:02 redo02.log
-rw-r----- 1 oracle oinstall 52429312 Sep 28 17:02 redo03.log
-rw-r----- 1 oracle oinstall 545267712 Sep 28 17:02 sysaux01.dbf
-rw-r----- 1 oracle oinstall 744497152 Sep 28 17:02 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 Sep 28 17:01 temp01.dbf
-rw-r----- 1 oracle oinstall 26222592 Sep 28 17:02 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 Sep 28 17:02 users01.dbf
--测试ok.这样正常5分钟就可以建立一个测试数据库.