반응형

------------------------------------------
--tablespace
------------------------------------------
--생성
CREATE TABLESPACE kimtest
DATAFILE '$ORACLE_BASE/oradata/green/kimtest.dbf' SIZE 50M AUTOEXTEND ON NEXT 5M;

--수정
ALTER DATABASE DATAFILE '$ORACLE_BASE/oradata/green/cmsdemo.dbf' AUTOEXTEND ON NEXT 10M MAXSIZE 10000M;

--삭제
DROP TABLESPACE kimtest INCLUDING CONTENTS;

--이동 (table을 tablespace 이동
ALTER INDEX 인덱스_이름 REBUILD TABLESPACE 옮길_테이블스페이스_이름;

--보기 (system 전체 tablespace)
SELECT  tablespace_name, file_name, bytes
FROM    dba_data_files;

--보기 (유저 table 목록 보기)
SELECT * FROM tab;

------------------------------------------
--user
------------------------------------------
--생성
CREATE USER kimtest IDENTIFIED BY kimtest DEFAULT TABLESPACE kimtest;

--권한주기
GRANT CONNECT, RESOURCE, CREATE TABLE TO kimtest;

--삭제(include user's tables)
DROP USER kimitest cascade;

--보기 (oracle server 접속 유저 보기)
select * from v$session where type = 'USER'


------------------------------------------
--Exporting & Importing
------------------------------------------
--Database
# exp system/manager file=wcms4.dmp full=y log=wcms4.log
  (compress=y grants=y rows=y)
  (rows=n : only schema backup)
# imp system/manager file=wcms4.dmp full=y commit=y
  (grants=y rows=y)

--User Object
# exp system/manager file=wcms4.dmp owner=wcms4
# imp system/manager file=wcms4.dmp fromuser=wcms4 touser=wcms4 commit=y
  (full=n grants=y rows=y)

--Tablespace
# exp system file=wcms4_1.dmp tablespaces=wcms4
# imp system file=wcms4_1.dmp tablespaces=kimi fromuser=wcms4 touser=kimi
# imp system file=jongno-wcms4-20040202.dmp fromuser=cmsuser touser=jongnoweb


------------------------------------------
--Oracle 시작과 종료
------------------------------------------
-- # lsnrctl start
-- # dbshut
-- # sqlplus /nolog
-- SQL> connect /as sysdba
-- SQL> startup
-- SQL> shutdown immediate
------------------------------------------



------------------------------------------
--Table
------------------------------------------
-- 속성보기
DESC MYTABLE;



-- 현재 사용자의 테이블 스페이스와 테이블 보기

select tablespace_name, table_name from tabs;





기타

◆ DB에 있는 모든 Table 이름보기

select table_name from user_tables



◆ Table의 Primary Key 찾기

select * from user_ind_columns where table_name = 'CodeTable'



◆ 서로 연결되는 Key를 찾는 방법

select constraint_name, constraint_type, r_constraint_name

from user_constraints where table_name = 'TABLE_NAME



◆ Constraint 확인

select table_name, constraint_name, constraint_type

from user_constraints

where table_name in ('DEPARTMENT','EMPLOYEE');



◆ Parameter정보 보기 (한/영코드값, 버젼정보등을 볼수있다.)

select * from nls_database_parameters
반응형
반응형

alter table pk가 잡힌 테이블
drop constraint 인덱스명;
--- 참고 ---
dsn링크입니다.
http://database.sarang.net/?inc=read&aid=22249&criteria=oracle&subcrit=&id=&limit=20&keyword=index+%BB%E8%C1%A6&page=3
반응형

'Tip & Tech > Both | Other' 카테고리의 다른 글

오라클 instant client 설치 법  (0) 2010.10.20
오라클 create, alter, delete  (0) 2010.10.20
오라클 테이블 스페이스 만들기.  (0) 2010.10.20
MySQL Dump & Restore  (0) 2010.10.20
오라클 오류번호-설명  (0) 2010.10.20
반응형

sqlplus /nolog
sql> connect /as sysdba
sql> create tablespace 테이블스페이스명
  logging
  datafile '/oracle/oradata/ora8/테이블스페이스파일명.dbf'
  size 32m
  autoextend on
  next 32m maxsize 2048m
  extent management local;


관련 참조사이트
http://lovapi.tistory.com/31
반응형

'Tip & Tech > Both | Other' 카테고리의 다른 글

오라클 create, alter, delete  (0) 2010.10.20
오라클 index로 잡힌 pk 삭제 법.  (0) 2010.10.20
MySQL Dump & Restore  (0) 2010.10.20
오라클 오류번호-설명  (0) 2010.10.20
MySQL 외부접속 방법.  (0) 2010.10.20
반응형

Postgre SQL 8.0 사용시

ODBC연결을 이용하면

서버측에 열린 세션이 풀링 되면서

해제된 세션이 남아 있는 현상이 발생하며

이때문에 ODBC 드라이버에 버퍼 오버플로우가 발생하여

응용 프로그램이 오류를 내며

열린 ODBC 드라이버는 응용프로그램이 종료되기전까지 사용불가능하게 된다

이 방법을 해결하는 법은



ODBC 데이터 원본 에서

풀링 탭에서

그림과 같이 PostgreSQL 드라이버에 풀링 시간 설정.
반응형

+ Recent posts