oracle11g手工建库-创新互联
1.设置环境变量
成都创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站设计制作、成都做网站、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的孟连网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴![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.准备密码文件及初始化参数文件和创建数据库脚本
[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.准备创建数据库需要的相关目录
[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.开始手工建库
[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 ----------------------------创建数据字典
……
PL/SQLprocedure successfully completed.
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMPCATALOG 2016-01-26 00:07:42
SQL> @?/rdbms/admin/catproc.sql-----------------------------创建存储过程和数据库的包
......
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.完成手工建库
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
当前标题:oracle11g手工建库-创新互联
当前路径:http://myzitong.com/article/csjscc.html