Ubuntu oracle

本文详细介绍Oracle数据库的启动与关闭流程,包括启动TNS监听器、使用SQL*Plus进行数据库管理,以及创建表空间、用户和导入数据文件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一:安装 省略..

二:启动
1,以oracle用户登录
su oracle
2,启动TNS监听器
$ORACLE_HOME/bin/lsnrctl start
3,用sqlplus启动数据库
$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> startup
出现如下显示,表示Oracle已经成功启动
ORACLE instance started.

Total System Global Area 205520896 bytes
Fixed Size 778392 bytes
Variable Size 74456936 bytes
Database Buffers 130023424 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.

4 启动 sqlplus
$ORACLE_HOME/bin/isqlplusctl start
5 启动em
emctl start dbconsole启动EM console服务,使用前需要先设置ORACLE_SID环境变量
emctl stop dbconsole停止EM console服务,使用前需要先设置ORACLE_SID环境变量


三:停止
1,用sqlplus停止数据库
$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> shutdown
出现如下显示,表示oracle已经停止
Database closed.
Database dismounted.
ORACLE instance shut down.

ORACLE_HOME/bin/emctl start dbconsole
$ORACLE_HOME/bin/isqlplusctl start


四、数据操作
1、创建表空间
create tablespace study
logging
datafile '/opt/ora10/oradata/orcl/study.dbf'
size 300m
autoextend on
next 32m maxsize 2048m
extent management local
2、创建用户
CREATE USER "UNIONPAYNEW" PROFILE "DEFAULT" IDENTIFIED BY "*******" DEFAULT TABLESPACE "STUDY" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK
GRANT UNLIMITED TABLESPACE TO "UNIONPAYNEW" WITH ADMIN OPTION
GRANT "CONNECT" TO "UNIONPAYNEW" WITH ADMIN OPTION
GRANT "DBA" TO "UNIONPAYNEW" WITH ADMIN OPTION
GRANT "RESOURCE" TO "UNIONPAYNEW" WITH ADMIN OPTION
3、导入数据文件 dmp文件
oracle@haijun-laptop:/opt/ora10/bin$ imp

Import: Release 10.2.0.1.0 - Production on Tue Mar 13 13:10:59 2012

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

Username: unionpaynew
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Import file: expdat.dmp > /home/oracle/soft/unionpay.dmp
Enter insert buffer size (minimum is 8192) 30720>

Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
export client uses ZHS16GBK character set (possible charset conversion)
List contents of import file only (yes/no): no >

Ignore create error due to object existence (yes/no): no >

Import grants (yes/no): yes >

Import table data (yes/no): yes >

Import entire export file (yes/no): no >
Username: unionpaynew

Enter table(T) or partition(T:P) names. Null list means all tables for user
Enter table(T) or partition(T:P) name or . if done:

. importing UNIONPAYNEW's objects into UNIONPAYNEW
. . importing table "MP_WALLET" 0 rows imported
. . importing table "OCS_CL3" 3 rows imported
. . importing table "TBACTIVE_NOTICE_INFO" 4 rows imported
. . importing table "TBAPPEAL_INFO" 0 rows imported
. . importing table "TBBLACK_LIST" 0 rows imported
. . importing table "TBBLACK_LIST_REC" 0 rows imported
. . importing table "TBCARDBIN_INFO" 2268 rows imported
. . importing table "TBCARD_BIN_ISPAY" 509 rows imported

Import terminated successfully with warnings.
oracle@haijun-laptop:/opt/ora10/bin$
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值