Ubuntu oracle

一:安装  省略..

二:启动
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$

猜你喜欢

转载自haijun0314.iteye.com/blog/1703453