1 安裝
- 安裝oracle
- 設置服務機ip
- 關閉防火牆
- 修改文件localhost爲服務及ip:
C:\app\init\product\11.2.0\dbhome_1\NETWORK\ADMIN
- 重啓服務即可遠程連接
2 創建用戶
sqlplus test/z123@10.10.10.10:1521/orcl
sqlplus / nolog
connect / as sysdba
conn scott/tiger
conn / as sysdba
create user test identified by 123 ACCOUNT UNLOCK;
alter user test identified by 234;
drop user user1;
grant
CONNECT
,resource
,dba
,create view
,drop view
,execute on dbms_lock
to scott;
revoke resource,dba,create view to scott;
3 常用系統操作
set linesize 300;
set pagesize 300;
show user;
select * from tab;
desc tbname;
host cls
ed
/
a order by ts_code
spool e:/note.sql
spool off;
select userenv('language') from dual;
select * from V$NLS_PARAMETERS;
alter session set NLS_DATE_FORMAT = 'yyy-mm-dd'