1.設(shè)置環(huán)境變量
成都創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的孟連網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴![oracle@HE3~]$ vi .bash_profile
exportPATH exportEDITOR=vi exportORACLE_SID=orcl exportORACLE_BASE=/u01/app/oracle exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 exportnls_date_format="yyyy-mm-dd hh34:mi:ss" exportPATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:$PATH exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib #aliassqlplus='rlwrap sqlplus' #aliasrman='rlwrap rman' exportNLS_LANG=AMERICAN_AMERICA.ZHS16GBK[oracle@HE3 ~]$ source .bash_profile
2.準(zhǔn)備密碼文件及初始化參數(shù)文件和創(chuàng)建數(shù)據(jù)庫(kù)腳本
[oracle@HE3~]$ cd $ORACLE_HOME/dbs
[oracle@HE3dbs]$ ls
hc_orcl.dat init.ora initorcl.ora lkORCL
[oracle@HE3dbs]$ orapwd file=orapwdorcl password=oracle entries=30
[oracle@HE3dbs]$ ls
hc_orcl.dat init.ora initorcl.ora lkORCL orapwdorcl
[oracle@HE3 dbs]$ vi initorcl.ora
diagnostic_dest='/u01/app/oracle' db_name='orcl' memory_target=512M processes= 150 audit_file_dest='/u01/app/oracle/admin/orcl/adump' audit_trail='db' db_block_size=8192 db_domain='' db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' db_recovery_file_dest_size=512M diagnostic_dest='/u01/app/oracle' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' control_files=(/u01/app/oracle/oradata/orcl/control01.ctl,/u01/app/oracle/oradata/orcl/control02.ctl) compatible='11.2.0'3.準(zhǔn)備創(chuàng)建數(shù)據(jù)庫(kù)需要的相關(guān)目錄
[oracle@HE3dbs]$ mkdir -p /u01/app/oracle/admin/orcl/adump/
[oracle@HE3dbs]$ mkdir -p /u01/app/oracle/flash_recovery_area
[oracle@HE3dbs]$ mkdir -p /u01/app/oracle/oradata/orcl
[oracle@HE3dbs]$ ls
hc_orcl.dat init.ora initorcl.ora lkORCL orapwdorcl
4.開(kāi)始手工建庫(kù)
[oracle@ENMOEDU ENMOEDU]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 10 00:39:10 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1071333376 bytes
Fixed Size 1349732 bytes
Variable Size 620758940 bytes
Database Buffers 444596224 bytes
Redo Buffers 4628480 bytes
[oracle@HE3~]$ vi create_db.sql
CREATEDATABASE orcl USER SYS IDENTIFIED BY oracle USER SYSTEM IDENTIFIED BY oracle LOGFILE GROUP 1('/u01/app/oracle/oradata/orcl/redo01a.log','/u01/app/oracle/oradata/orcl/redo01b.log')SIZE 50M BLOCKSIZE 512, GROUP 2('/u01/app/oracle/oradata/orcl/redo02a.log','/u01/app/oracle/oradata/orcl/redo02b.log')SIZE 50M BLOCKSIZE 512, GROUP 3('/u01/app/oracle/oradata/orcl/redo03a.log','/u01/app/oracle/oradata/orcl/redo03b.log')SIZE 50M BLOCKSIZE 512 MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 CHARACTER SET ZHS16GBK NATIONAL CHARACTER SET AL16UTF16 EXTENT MANAGEMENT LOCAL DATAFILE'/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 325M REUSE SYSAUX DATAFILE'/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 325M REUSE DEFAULT TABLESPACE users DATAFILE'/u01/app/oracle/oradata/orcl/users01.dbf' SIZE 500M REUSE AUTOEXTEND ON MAXSIZEUNLIMITED DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE'/u01/app/oracle/oradata/orcl/temp01.dbf' SIZE 20M REUSE UNDO TABLESPACE undotbs1 DATAFILE'/u01/app/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZEUNLIMITED;[oracle@HE3~]$ tail -100f /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
SQL>@/home/oracle/create_db.sql
Databasecreated.
SQL>@?/rdbms/admin/catalog.sql ----------------------------創(chuàng)建數(shù)據(jù)字典
……
PL/SQLprocedure successfully completed.
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMPCATALOG 2016-01-26 00:07:42
SQL> @?/rdbms/admin/catproc.sql-----------------------------創(chuàng)建存儲(chǔ)過(guò)程和數(shù)據(jù)庫(kù)的包
......
SQL>
SQL> SELECT dbms_registry_sys.time_stamp('CATPROC') AS timestamp FROM DUAL;
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATPROC 2014-02-10 01:25:21
1 row selected.
SQL>
SQL> SET SERVEROUTPUT OFF
SQL>
SQL>
SQL> select status from v$instance;
STATUS
------------
OPEN
1 row selected.
SQL> quit
5.完成手工建庫(kù)
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。