Oracle»ù´¡Ñ§Ï°±Ê¼Ç
1.sqlplus-----¿ªÆô·þÎñ
2.ÊäÈëÓû§ÃûºÍÃÜÂ루ĬÈÏ3¸öÓû§,×¢Ò⣬ÃÜÂëÊÇ¿ÉÒÔÐ޸ĵģºsystem/manager;scott/tiger;sys/change_on_install£©£¬Á¬½ÓÊý¿â¡£
3.´´½¨±í¿Õ¼ä£º
create tablespace ±í¿Õ¼äÂß¼Ãû datafile '±í¿Õ¼äÎļþµÄÎïÀíÂß¼'
size Îļþ´óС£¨È磺10m£© autoextend ÊÇ·ñ×Ô¶¯Ôö³¤Îļþ´óС£¨on/off£©;
4.´´½¨Óû§£ºcreate user Óû§Ãû identified by ÃÜÂ룻
5.Óû§ÊÚȨ£ºgrant connect to Óû§Ãû --------±íʾÊÚÓèÓû§Á¬½ÓµÄȨÏÞ
grant dba to Óû§Ãû ------±íʾÊÚÓè¹ÜÀíÔ±µÄȨÏÞ
grant resource to Óû§Ãû -----±íʾ´´½¨Ò»¸öȨÏÞ¶ÔÏó
--Á¬½Ó
conn admin/admin;
--Á¬½Óµ±Ç°Óû§
conn yangjian/yangjian;
--ÐÞ¸ÄÓû§ÃÜÂë
alter user system identified by system;
--ɾ³ýÓû§(cascadeɾ³ýģʽ¶ÔÏó)
drop user admin cascade;
6.exit -----Í˳öÁ¬½Ó
7.´´½¨±í£º
create table ±íÃ÷
£¨
sid varchar2(20), --varchar2±íʾ¶¯Ì¬µÄ×Ö·ûÀàÐÍ
sage int ----Êý×ÖÀàÐÍ
£©;
--ɾ³ý±í¿Õ¼ä
Drop tablespace spac
--Ð޸ıí
--1.Ϊָ¶¨µÄ±íÌí¼ÓÒ»ÁÐ
alter table student add(score varchar2(3))
--2.ÐÞ¸ÄÖ¸¶¨ÁÐ
alter table student modify(score number(3,1))
--3.ɾ³ýÖ¸¶¨µÄÁÐ
alter table student drop column score
--4.²é¿´Ö¸¶¨±íµÄ½á¹¹
desc student
--ɾ³ý±í
--1.ֻɾ³ý±íÖеÄËùÓÐÊý¾Ý£¬±£Áô±íµÄ½á¹¹
truncate table student
delete student;
--2.ɾ³ýÕû¸ö±í£¬°üÀ¨±íµÄÕû¸ö½á¹¹
drop table student
8.show user ------ÏÔʾµ±Ç°µÇ½Óû§Ãû
9.´´½¨Ò»¸öÐòÁУº
create sequence ÐòÁÐÃû start with 1 increment by 2 minvalue 1 maxvalue 2000
cycle/uncycle; -----±íʾ¸ÃÐòÁдÓ1¿ªÊ¼£¬×ÔÔö2£¬×îСֵ1£¬×î´óÖµ2000£¬cycle±íʾµ½´ï×î´óÖµºó
Ïà¹ØÎĵµ£º
ÖйúµçÁ¦ÐÐҵĿǰÕýÔÚ¾Àúמ޴óµÄ±ä»¯£º´Ó¹ú¼Ò°ìµçµ½ÆóÒµ°ìµç£¬ÐγÉÁ˶à¼Ò¾ºÕù°ìµçµÄ¸ñ¾Ö£»³§Íø·Ö¿ª¡¢¾º¼ÛÉÏÍø£¬´Ó¼Æ»®µ½Êг¡×ª¹ì£¬ÒýÈë¶àÖÖ¾¼Ã³É·Ö£»´ÓµØÓòÐÔ·ÖÉ¢¹©µçÏò´óµçÍø·¢Õ¹£»´ÓÕþÆó²»·Öµ½ÕþÆó·Ö¿ª¡£ÕâЩ±ä»¯£¬Ê¹ÖйúµÄµçÁ¦ÐÐÒµ¾ÊÜ×ÅÇ°ËùδÓеÄѹÁ¦¡£
Ò»·½Ã棬2003Äê¹úÄڵķ¢µçÆóÒµÖØиÄ×é£ ......
Ò»¡¢java·ÃÎÊÖÐÎÄOracleÊý¾Ý¿âÉÏÁ¬½ÓµÄUS7ASCIIÊý¾Ý¿â
1¡¢¶Á·½·¨
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] ......
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* ´Ë´¦²åÈëÀàÐÍ˵Ã÷¡£
* ´´½¨ÈÕÆÚ£º(2001/11/30 14:55 ......
oracle³£ÓÃÊý¾ÝÀàÐÍ
½ñÌìͬÊÂÎÊЩÊý¾ÝÀàÐ͵ÄÎÊÌ⣬ÓеĻ¹ÕæÓеã¼Ç²»ÇåÁË£¬ÓÚÊǾͼòµ¥×ܽáϳ£ÓõÄÊý¾ÝÀàÐÍÒÔ±¸ÈÕºó²éÓÃ
1¡¢Char
¶¨³¤¸ñʽ×Ö·û´®£¬ÔÚÊý¾Ý¿âÖд洢ʱ²»×ãλÊýÌî²¹¿Õ¸ñ£¬ËüµÄÉùÃ÷·½Ê½ÈçÏÂCHAR(L)£¬LΪ×Ö·û´®³¤¶È£¬
ȱʡΪ1£¬×÷Ϊ±äÁ¿×î´ó32767¸ö×Ö·û£¬×÷ΪÊý¾Ý´æ´¢ÔÚORACLE8ÖÐ×î´óΪ2000¡£²»½¨ÒéʹÓ㬻ᴠ......
OracleÖеÄÐòÁкŹËÃû˼Òå¾ÍÊÇ´´½¨Ò»¸öÐòÁкţ¬¿ÉÒÔÔÚ²åÈë»òÕ߸üеÄʱºòµ÷Óã¬Ï൱ÓÚÊÇÒ»¸öÉú³ÉÆ÷
´´½¨Óï·¨£º
create sequence myse
increment by 1 --Ôö³¤¶È
start with
1 --´ÓÄÄÀïÔö¼Ó£¬¾ÍÊÇ˵ÏÂÒ»¸ö»ñÈ¡µÄÖµ´ÓÕâ¸öÖµ ......