Oracle 小筆記

— Create sequence
create sequence TEST_SQ
minvalue 1
maxvalue 9999999999
start with 21
increment by 1
cache 20;

select test_sq.nextval from dual
select test_sq.currval from dual

sqlplus sysman/sysman
sqlplus sysman/oracle
lsnrctl status
sqlplus /nolog

emctl status
emctl start dbconsole
emctl stop dbconsole

/etc/init.d/vmware-tools status

lsnrctl start

[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release – Production on Tue Sep 30 01:46:26 2008

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

SQL> conn / as sysdba
Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 314572800 bytes
Fixed Size 1267236 bytes
Variable Size 180357596 bytes
Database Buffers 130023424 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.

conn / as sysdba
shutdown immediate

emctl start dbconsole

Oracle Enterprise Manager

sqlplus /nolog

SQL*Plus: Release – Production on Wed Oct 1 18:50:04 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL> conn scott/password@db1