oracle安装成功之后检查简单命令

此篇文章来看下如果进入oracle的数据库.
[oracle@oracle01 tools]$ ps -elf | grep ora_ | grep orcl   #查看进程
0 S oracle    12438      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_pmon_orcl
0 S oracle    12440      1  0  80   0 - 185418 semtim 12:50 ?       00:00:01 ora_psp0_orcl
0 S oracle    12442      1  1  58   - - 185418 hrtime 12:50 ?       00:01:24 ora_vktm_orcl
0 S oracle    12446      1  0  80   0 - 185845 semtim 12:50 ?       00:00:00 ora_gen0_orcl
0 S oracle    12448      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_mman_orcl
0 S oracle    12452      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_diag_orcl
0 S oracle    12454      1  0  80   0 - 186666 semtim 12:50 ?       00:00:01 ora_dbrm_orcl
0 S oracle    12456      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_vkrm_orcl
0 S oracle    12458      1  0  80   0 - 186058 semtim 12:50 ?       00:00:04 ora_dia0_orcl
0 S oracle    12460      1  0  80   0 - 188392 semtim 12:50 ?       00:00:01 ora_dbw0_orcl
0 S oracle    12462      1  0  80   0 - 186745 semtim 12:50 ?       00:00:01 ora_lgwr_orcl
0 S oracle    12464      1  0  80   0 - 186489 semtim 12:50 ?       00:00:05 ora_ckpt_orcl
0 S oracle    12466      1  0  80   0 - 186413 semtim 12:50 ?       00:00:00 ora_smon_orcl
0 S oracle    12468      1  0  80   0 - 186674 semtim 12:50 ?       00:00:00 ora_reco_orcl
0 S oracle    12470      1  0  80   0 - 186332 ep_pol 12:50 ?       00:00:00 ora_lreg_orcl
0 S oracle    12472      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_pxmn_orcl
0 S oracle    12474      1  0  80   0 - 186206 semtim 12:50 ?       00:00:00 ora_rbal_orcl
0 S oracle    12476      1  0  80   0 - 186364 pipe_w 12:50 ?       00:00:00 ora_asmb_orcl
0 S oracle    12478      1  0  80   0 - 187523 semtim 12:50 ?       00:00:09 ora_mmon_orcl
0 S oracle    12482      1  0  80   0 - 185880 semtim 12:50 ?       00:00:04 ora_mmnl_orcl
0 S oracle    12484      1  0  80   0 - 187179 ep_pol 12:50 ?       00:00:00 ora_d000_orcl
0 S oracle    12486      1  0  80   0 - 200484 semtim 12:50 ?       00:00:00 ora_mark_orcl
0 S oracle    12488      1  0  80   0 - 185947 ep_pol 12:50 ?       00:00:00 ora_s000_orcl
0 S oracle    12516      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_tmon_orcl
0 S oracle    12518      1  0  80   0 - 185417 hrtime 12:50 ?       00:00:00 ora_tt00_orcl
0 S oracle    12520      1  0  80   0 - 185418 semtim 12:50 ?       00:00:00 ora_smco_orcl
0 S oracle    12522      1  0  80   0 - 187305 semtim 12:50 ?       00:00:00 ora_w000_orcl
0 S oracle    12524      1  0  80   0 - 189511 semtim 12:50 ?       00:00:01 ora_w001_orcl
0 S oracle    12526      1  0  80   0 - 186504 semtim 12:50 ?       00:00:00 ora_aqpc_orcl
0 S oracle    12530      1  0  80   0 - 185417 semtim 12:50 ?       00:00:00 ora_p000_orcl
0 S oracle    12532      1  0  80   0 - 185417 semtim 12:50 ?       00:00:00 ora_p001_orcl
0 S oracle    12534      1  0  80   0 - 185417 semtim 12:50 ?       00:00:00 ora_p002_orcl
0 S oracle    12536      1  0  80   0 - 185417 semtim 12:50 ?       00:00:00 ora_p003_orcl
0 S oracle    12541      1  0  80   0 - 188335 semtim 12:50 ?       00:00:02 ora_cjq0_orcl
0 S oracle    12552      1  0  80   0 - 185890 semtim 12:50 ?       00:00:00 ora_qm02_orcl
0 S oracle    12556      1  0  80   0 - 186797 semtim 12:50 ?       00:00:00 ora_q002_orcl
0 S oracle    12558      1  0  80   0 - 185918 semtim 12:50 ?       00:00:00 ora_q003_orcl
0 S oracle    12916      1  0  80   0 - 186506 semtim 13:06 ?       00:00:00 ora_w002_orcl
0 S oracle    12922      1  0  80   0 - 186416 semtim 13:06 ?       00:00:00 ora_w003_orcl
0 S oracle    12924      1  0  80   0 - 185547 semtim 13:06 ?       00:00:00 ora_w004_orcl
0 S oracle    13646      1  0  80   0 - 185999 semtim 13:50 ?       00:00:03 ora_o000_orcl
0 S oracle    13899      1  0  80   0 - 185545 semtim 14:05 ?       00:00:00 ora_w005_orcl
0 S oracle    13908      1  0  80   0 - 185417 semtim 14:05 ?       00:00:00 ora_w006_orcl
 
[oracle@oracle01 tools]$ export ORACLE_SID=orcl    #设置默认登录库
[oracle@oracle01 tools]$ which sqlplus
/data/app/oracle/product/12.1.0/dbhome_1/bin/sqlplus

进入oracle数据库:

Oracle PL/SQL

[oracle@oracle01 tools]$ sqlplus / as sysdba    #本地oracle用户验证方式,不需要密码
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jul 2 14:31:06 2016
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> conn hr/hr 
ERROR:
ORA-28000: the account is locked
Warning: You are no longer connected to ORACLE.
SQL> alter user hr account unlock;    #解锁hr账号
SP2-0640: Not connected
SQL> show user;
USER is ""    #黑洞
SQL> alter user hr account unlock;    #解锁hr账号
User altered.
SQL> alter user hr indentified by hr;
alter user hr indentified by hr
              *
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> alter user hr identified by hr;    #修改hr密码为hr
User altered.
SQL> conn hr/hr
Connected.
SQL> show user;
USER is "HR"
SQL> conn / as sysdba
Connected.
SQL> show user;
USER is "SYS"
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> help index    #命令帮助
 
Enter Help [topic] for help.
 
 @             COPY         PAUSE                    SHUTDOWN
 @@            DEFINE       PRINT                    SPOOL
 /             DEL          PROMPT                   SQLPLUS
 ACCEPT        DESCRIBE     QUIT                     START
 APPEND        DISCONNECT   RECOVER                  STARTUP
 ARCHIVE LOG   EDIT         REMARK                   STORE
 ATTRIBUTE     EXECUTE      REPFOOTER                TIMING
 BREAK         EXIT         REPHEADER                TTITLE
 BTITLE        GET          RESERVED WORDS (SQL)     UNDEFINE
 CHANGE        HELP         RESERVED WORDS (PL/SQL)  VARIABLE
 CLEAR         HOST         RUN                      WHENEVER OSERROR
 COLUMN        INPUT        SAVE                     WHENEVER SQLERROR
 COMPUTE       LIST         SET                      XQUERY
 CONNECT       PASSWORD     SHOW
 
SQL> conn scott/admin123
Connected.
SQL> show user;
USER is "SCOTT"
SQL> select * from scott.dept'
  2  ;
ERROR:
ORA-01756: quoted string not properly terminated
 
SQL> select * from scott.dept;
 
    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
SQL> list    #上个命令
  1* select * from scott.dept
SQL> l    #list简写
  1* select * from scott.dept
SQL> /    #执行上个命令
 
    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
 
SQL> ? list
 
 LIST
 ----
 
 Lists one or more lines of the most recently executed SQL command
 or PL/SQL block which is stored in the SQL buffer. Enter LIST with
 no clauses to list all lines. In SQL*Plus command-line you can also
 use ";" to list all the lines in the SQL buffer. The buffer has no
 command history list and does not record SQL*Plus commands.
 
 L[IST] [n | n m | n  * | n LAST | * | * n | * LAST | LAST]
 
SQL> define _editor=vi
SQL> ed
SQL> ed 
Wrote file afiedt.buf
 
  1  select * from scott.emp
  2* where ename='SCOTT'
SQL> /
 
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7788 SCOTT      ANALYST         7566 19-APR-87       3000
        20
SQL> select * from scott.emp;
SQL> save /tmp/2016.07.02.sql
Created file /tmp/2016.07.02.sql
SQL> host
[oracle@oracle01 tools]$ cat /tmp/2016.07.02.sql
select * from scott.emp
/
[oracle@oracle01 tools]$ quti
bash: quti: command not found
[oracle@oracle01 tools]$ exit
exit
SQL> host pwd
/byrd/tools
SQL> @ /tmp/2016.07.02.sql    #远程脚本调用
SQL> get /tmp/2016.07.02.sql
  1* select * from scott.emp
SQL> spool /tmp/oracle.log    #日志记录
SQL> select * from scott.dept;
SQL> spool off   #结束
SQL> host cat /tmp/oracle.log
SQL> shutdown immediate;
ORA-01031: insufficient privileges
SQL> show user; 
USER is "SCOTT"
SQL> conn / as sysdba
Connected.
SQL> show user;
USER is "SYS"
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> show users;
SP2-0158: unknown SHOW option "users"
 
 
[grid@oracle01 ~]$ crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       oracle01                 STABLE
ora.FRA.dg
               ONLINE  ONLINE       oracle01                 STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       oracle01                 STABLE
ora.LISTERER2.lsnr
               ONLINE  OFFLINE      oracle01                 STABLE
ora.asm
               ONLINE  ONLINE       oracle01                 Started,STABLE
ora.ons
               OFFLINE OFFLINE      oracle01                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       oracle01                 STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       oracle01                 STABLE
ora.orcl.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
--------------------------------------------------------------------------------
SQL> startup
ORACLE instance started.
 
Total System Global Area  402653184 bytes
Fixed Size                  2924928 bytes
Variable Size             260050560 bytes
Database Buffers          134217728 bytes
Redo Buffers                5459968 bytes
Database mounted.
Database opened.
[grid@oracle01 ~]$ lsnrctl status
 
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 02-JUL-2016 19:52:41
 
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                02-JUL-2016 10:13:16
Uptime                    0 days 9 hr. 39 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/app/grid/product/12.1.0/grid/network/admin/listener.ora
Listener Log File         /data/app/grid/diag/tnslsnr/oracle01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle01.db.hangzhou.t4x.org)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oracle01.db.hangzhou.t4x.org)(PORT=5500))(Security=(my_wallet_directory=/data/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "orcl.t4x.org" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.t4x.org" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracle01 tools]$ netca
 
Oracle Net Services Configuration:
Stopping Oracle Net Listener:
    Listener stopped successfully.
    Deleted listener: LISTERER2
Oracle Net Services configuration successful. The exit code is 0

时间: 2025-01-29 18:19:05

oracle安装成功之后检查简单命令的相关文章

Oracle 和 mysql 的一些简单命令对比参照

mysql|oracle Oracle 和 mysql 的一些简单命令对比参照 Oraclemysql对比版本Personal Oracle7 Release 7.3.4.0.0mysql 3.22.34-shareware-debug启动画面(点击放大)默认安装目录C:\ORAWIN95C:\MYSQL各种实用程序所在目录C:\ORAWIN95\BINC:\MYSQL\BIN控制台工具SVRMGR.EXESVRMGR23.EXEmysqladmin.exe数据库启动程序0start73.exe

Oracle和MySQL的一些简单命令对比

Oracle和MySQL的一些简单命令对比 SQL> select to_char(sysdate,'yyyy-mm-dd') from dual; SQL> select to_char(sysdate,'hh24-mi-ss') from dual; mysql> select date_format(now(),'%Y-%m-%d'); mysql> select time_format(now(),'%H-%i-%S'); 日期函数 增加一个月: SQL> selec

Oracle安装过程中物理内存检查及临时temp空间不足问题解决

Oracle安装过程物理内存检查及临时temp空间不足的情况,想必有很多的朋友都有遇到过吧,下面与大家分享下具体的解决方法,感兴趣的朋友可以参考下哈   物理内存 – 此先决条件将测试系统物理内存总量是否至少为 922MB (944128.0KB). 预期值 : N/A 实际值 : N/A 错误列表: – 可用物理内存 PRVF-7531 : 无法在节点上执行物理内存检查 – Cause: 无法在指示的节点上执行物理内存检查. – Action: 确保可以访问指定的节点并可以查看内存信息. 可用

oracle-Oracle安装成功,之后登录不上去

问题描述 Oracle安装成功,之后登录不上去 我前几天把Oracle安装好了,当时也能用,但是今天发现却登录不上去,求大神指教,我是初学者,小弟感激不已. 解决方案 检查下oracle是否正确启动,是否有安装别的软件禁用了端口或者破坏了文件等. 解决方案二: oracle服务启动没,查看它的log看具体错误信息是什么. 解决方案三: 登录不进去的基本排查:1监听器没有启动.2登录权限没有赋予.3登录名被锁了4.数据库实例不正确.5.选择重装 解决方案四: 1.首先要看你是否安装了oracle客

PG学习初体验--源码安装和简单命令

   其实对于PG,自己总是听圈内人说和Oracle很相似,自己也有一些蠢蠢欲动学习的想法,从我的感觉来看,它是介于Oracle和MySQL之间的一种数据库,具备类似Oracle的功能,兼具MySQL的开源风格.所以个人感觉无论是从Oracle转向学习PG,还是从MySQL转向PG都会有一些独到的侧重方向.当然学习数据库本身不是目的,会的越多并不能说明你很牛,能够深入理解数据库,就如同感受的性格和处事风格,在合适的场景使用它,无想应该是超越于技术本身之外,而且难能可贵的.   其实我本身也是一个

oracle 安装与SQLPLUS简单用法_oracle

一 安装oracle数据库成功之后,会显示相关的数据库信息: 全局数据库名:oracle 系统标识符(SID):oracle 服务器参数文件名:c:\oracle\product\10.2.0\db_1/dbs/spfileoracle.ora Database Control URL为http://210.45.216.146:1158/em 数据库账户:SYS,SYSTEM,DBSNMP,SYSMAN 密码:oracle iSQL*Plus URL 为: http://210.45.216.

安装 Cassandra 服务,使用命令行进行key操作,很简单

1,目标 http://www.csdn.net/article/2013-06-11/2815734-instagram-making-the-switch-to-cassandra-from-redis http://blog.sina.com.cn/s/blog_6df127760101e8b7.html 之前看到一篇关于cassandra的文章,就有了想实践的想法. 官网:http://cassandra.apache.org/ 2,关于  Cassandra Apache Cassan

Oracle安装检查操作系统版本必须是5.0 5.1的解决办法

我在 oracle 10g R2 for windows 7 64bit 的安装时候发现了这个问题.经过验证可以解决问题. 这算是oracle的一个小bug 在检查操作系统版本的时候 windows-6.1 没有维护进去. 找到oracle安装文件中的 "oraparam.ini" 文件在里面 合适位置添加以下一段 (里面有一段和以下文字类似就是6.1换成6.0 放在6.0的后面即可) [Windows-6.1-required] #Minimum display colours fo

mysql5.1绿色版安装教程以及mysql相关命令(解决mysqld-nt不成功)

看了网上好多mysql5.1绿色版的安装教程都不成功,最后才发现网上的教程都有一个问题,版本太低了,在mysql5.1中已经没有mysqld-nt.exe 这个文件了,而大多数教程还在使用mysql-nt这个命令. 下面讲解mysql5.1解压缩版安装过程. http://dev.mysql.com/downloads/mirror.php?id=414168 上面链接是mysql-noinstall-5.1.71-win32.zip下载地址,注册不用管直接点下面的No thanks, just