Sunday, September 15, 2013

Oracle start and login remotly

login as: root
root@192.168.1.104's password:
Last login: Mon Sep  9 07:07:22 2013 from 192.168.1.103
[root@localhost ~]# ls
anaconda-ks.cfg  Documents  install.log         Music     Public     t -x
Desktop          Downloads  install.log.syslog  Pictures  Templates  Videos
[root@localhost ~]# /etc/init.d/oracle-xe start
Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.

[root@localhost ~]# sqlplus system
-bash: sqlplus: command not found
[root@localhost ~]# echo $ORACLE_HOME

[root@localhost ~]# /u01/app/oracle/product/11.2.0/xe
-bash: /u01/app/oracle/product/11.2.0/xe: is a directory
[root@localhost ~]# . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
[root@localhost ~]# /u01/app/oracle/product/11.2.0/xe
-bash: /u01/app/oracle/product/11.2.0/xe: is a directory
[root@localhost ~]# echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/xe
[root@localhost ~]# sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Sun Sep 15 11:33:03 2013

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

Enter user-name: sakib
Enter password:

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL>

Tuesday, July 30, 2013

Oracle Pl / SQL View Table Structure


SQL*Plus: Release 11.2.0.2.0 Production on Tue Jul 30 16:36:06 2013

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

SQL> CONNECT
Enter user-name: sakib
Enter password:
Connected.
SQL> DESC EMPLOYEES;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 EMP_ID                                             NUMBER(5)
 LASTNAME                                           VARCHAR2(20)
 FIRSTNAME                                          VARCHAR2(20)
 ADDRESS                                            VARCHAR2(200)
 CITY                                               VARCHAR2(15)

SQL> DESCRIBE EMPLOYEES;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 EMP_ID                                             NUMBER(5)
 LASTNAME                                           VARCHAR2(20)
 FIRSTNAME                                          VARCHAR2(20)
 ADDRESS                                            VARCHAR2(200)
 CITY                                               VARCHAR2(15)

SQL>

Oracle PL / SQL View All Tables


SQL*Plus: Release 11.2.0.2.0 Production on Tue Jul 30 15:26:44 2013

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

SQL> connect
Enter user-name: sakib
Enter password:
Connected.
SQL> SELECT * FROM TAB;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
APEX$_ACL                      TABLE
APEX$_WS_FILES                 TABLE
APEX$_WS_HISTORY               TABLE
APEX$_WS_LINKS                 TABLE
APEX$_WS_NOTES                 TABLE
APEX$_WS_ROWS                  TABLE
APEX$_WS_TAGS                  TABLE
APEX$_WS_WEBPG_SECTIONS        TABLE
APEX$_WS_WEBPG_SECTION_HISTORY TABLE
BIN$GjcOCe4nTyqOjoQ/XP3mQQ==$0 TABLE
BIN$aQemt3i5QueBOU2cSMlBmg==$0 TABLE

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
DEMO_CUSTOMERS                 TABLE
DEMO_ORDERS                    TABLE
DEMO_ORDER_ITEMS               TABLE
DEMO_PRODUCT_INFO              TABLE
DEMO_STATES                    TABLE
DEMO_USERS                     TABLE
DEPT                           TABLE
EMP                            TABLE
EMPLOYEES                      TABLE
HTMLDB_PLAN_TABLE              TABLE

21 rows selected.

SQL>

Oracle 11 EX SQL*Plus User Login


SQL*Plus: Release 11.2.0.2.0 Production on Tue Jul 30 15:26:44 2013

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

SQL> connect
Enter user-name: sakib
Enter password:
Connected.
SQL>