首页 >

Oracle 11gR2 创建数据库实例

数据库|mysql教程Oracle 11gR2 创建数据库实例
Oracle 11g,Oracle 11gR2,Oracle
数据库-mysql教程
师生交流系统源码,vscode版本比对,2019ubuntu平板,tomcat日志端口,qt sqlite 匹配,eclipse ajax 插件,dy02前端框架,java爬虫训练,php in查询,cms seo,社交网站带后台,动态刷新 网页表格,.net 数据模板与,jquery页面滚动加载,培训班管理系统源代码,微信小程序源码 商城lzw
因为工作需要在Oracle 11gR2库中新建一数据库实例。采用脚本命令创建,建议使用oracle用户进行以下操作。顺序如下:1.创建实例启
c mail收发源码,ubuntu系统缓存清理,彻底的反爬虫,php钟表,seo有发展lzw
系统之家asp源码,ubuntu时间显示位置,服务器上重启tomcat,Python爬虫模式,php中怎么做配置,梅州seo排名lzw

startup nomount pfile=”/u01/oracle/product/11.2.0.1/db1/dbs/initcrm.ora”;
CREATE DATABASE “crm”
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE ‘/u01/oracle/oradata/system01.dbf’ SIZE 1024M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE ‘/u01/oracle/oradata/sysaux01.dbf’ SIZE 500M REUSE
SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE ‘/u01/oracle/oradata/temp01.dbf’ SIZE 20M REUSE
SMALLFILE UNDO TABLESPACE “UNDOTBS1” DATAFILE ‘/u01/oracle/oradata/undo01.dbf’ SIZE 300M REUSE
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 (‘/u01/oracle/oradata/log01.dbf’) SIZE 50M,
GROUP 2 (‘/u01/oracle/oradata/log02.dbf’) SIZE 50M,
GROUP 3 (‘/u01/oracle/oradata/log03.dbf’) SIZE 50M;

创建USERS表空间
CREATE SMALLFILE TABLESPACE “USERS” LOGGING DATAFILE ‘/u01/app/oradata/user01.dbf’ SIZE 1000M REUSE EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
ALTER DATABASE DEFAULT TABLESPACE “USERS”;

——————————————

SQL> create spfile from pfile;

File created.

—————————————–

sqlplus / as sysdba
SQL> show user;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catalog.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catblock.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catproc.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catoctk.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/owminst.plb;


使用system用户编译
@/u01/oracle/product/11.2.0.1/db1/sqlplus/admin/pupbld.sql;
@/u01/oracle/product/11.2.0.1/db1/sqlplus/admin/help/hlpbld.sql helpus.sql;

使用sys用户编译
@/u01/oracle/product/11.2.0.1/db1/javavm/install/initjvm.sql;
@/u01/oracle/product/11.2.0.1/db1/xdk/admin/initxml.sql;
@/u01/oracle/product/11.2.0.1/db1/xdk/admin/xmlja.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catjava.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catexf.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catqm.sql change_on_install SYSAUX TEMP YES;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catxdbj.sql;
@/u01/oracle/product/11.2.0.1/db1/rdbms/admin/catrul.sql;

spool /oracle/admin/edidb/scripts/ordinst.log append
@/u01/oracle/product/11.2.0.1/db1/ord/admin/ordinst.sql SYSAUX SYSAUX;
spool off

spool /u01/oracle/admin/ora11g/scripts/interMedia.log append
@/u01/oracle/product/11.2.0.1/db1/ord/im/admin/iminst.sql;
spool off

set echo on
spool /oracle/admin/edidb/scripts/lockAccount.log append
BEGIN
FOR item IN ( SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS IN (‘OPEN’, ‘LOCKED’, ‘EXPIRED’) AND USERNAME NOT IN (
‘SYS’,’SYSTEM’) )
LOOP
dbms_output.put_line(‘Locking and Expiring: ‘ || item.USERNAME);
execute immediate ‘alter user ‘ ||
sys.dbms_assert.enquote_name(
sys.dbms_assert.schema_name(
item.USERNAME),false) || ‘ password expire account lock’ ;
END LOOP;
END;
/
spool off

到此,数据库实例建立完毕。

6.配置tns与listenser /u01/oracle/product/11.2.0.1/db1/network/admin/下

tnsnames.ora

CRM = (DESCRIPTION =

(ADDRESS_LIST = (ADDRESS =

(PROTOCOL = TCP) (HOST = 127.0.0.1)(PORT = 1521)

)

)

(CONNECT_DATA = (SERVICE_NAME = crm)

)

)

listener.ora 监听方式有多种,要求不高的话建议复用原监听,,好处是变动小,缺点是不同实例公用监听,可能会不方便。

listener.ora

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /u01/oracle/product/11.2.0.1/db1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = crm)
(ORACLE_HOME = /u01/oracle/product/11.2.0.1/db1)
(SID_NAME = crm)
)
)

单配监听:


Oracle 11gR2 创建数据库实例
  • Oracle 11gR2的延迟段功能
  • Oracle 11gR2的延迟段功能 | Oracle 11gR2的延迟段功能 ...

    Oracle 11gR2 创建数据库实例
  • Oracle 11g中lock的增强
  • Oracle 11g中lock的增强 | Oracle 11g中lock的增强 ...

    Oracle 11gR2 创建数据库实例
  • Oracle 11g数据库之闪回与回收站
  • Oracle 11g数据库之闪回与回收站 | Oracle 11g数据库之闪回与回收站 ...