频道栏目
首页 > 资讯 > 其他综合 > 正文

Centos7环境下oracle命令行创建一个数据库

17-09-25        来源:[db:作者]  
收藏   我要投稿

 

[oracle@localhost dbs]$ export ORACLE_SID=bp               #这里假设我要创建一个名bp的数据库
[oracle@localhost dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 22 03:11:56 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup                                                #这个是因为我上一个数据库没有关闭,所以导致的
ORA-00845: MEMORY_TARGET not supported on this system
#先创建一个bp数据库初始化文件,开启数据库时会读取这个文件,可以命名为spfilebp.ora,spfile.ora,initbp.ora,优先级递减
SQL> ! echo "db_name=bp">/u01/app/oracle/product/11.2.0./db_1/dbs/initbp.ora     
SQL> quit                                                   #不退出也可以,但是要关闭前一个数据库
Disconnected
[oracle@localhost dbs]$ export ORACLE_SID=shenlan           #我的上一个数据库时shenlan
[oracle@localhost dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 22 03:17:24 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit     
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost dbs]$ export ORACLE_SID=bp                   #再次export为新的数据库名
[oracle@localhost dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 22 03:19:27 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup                                        #ko
ORACLE instance started.

Total System Global Area  759943168 bytes
Fixed Size          2257112 bytes
Variable Size         499126056 bytes
Database Buffers      255852544 bytes
Redo Buffers            2707456 bytes
Database mounted.
Database opened.
SQL>            
相关TAG标签
上一篇:Kafka的分区机制介绍与代码实例
下一篇:AWS IoT限制、物联网对象限制、Device Shadow 限制
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站