暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 静默模式下增删改表的字段

原创 章芋文 2012-06-24
633
[size=2][oracle@rac2 ~]$ sqlplus sys/oracle@myorc1 as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 25 10:16:55 2011

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> alter system quiesce restricted;

System altered.
SQL> conn scott/oracle
/////////////////////////////////一直等


再开窗口

[oracle@rac2 ~]$ sqplus sys/oracle@myorc1 as sysdba
bash: sqplus: command not found
[oracle@rac2 ~]$ sqlplus sys/oracle@myorc1 as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 25 10:20:51 2011

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> alter table scott.pic add test varchar2(20);

Table altered.

SQL> desc scott.pic
Name Null? Type
----------------------------------------- -------- ----------------------------
PATH NOT NULL VARCHAR2(200)
IP NOT NULL VARCHAR2(15)
LOADTIME DATE
OWNER NOT NULL VARCHAR2(15)
SCORE integer
LOCKED NOT NULL CHAR(5)
TEST VARCHAR2(20)

SQL> alter table scott.pic modify test number(20);

Table altered.

SQL> desc scott.pic
Name Null? Type
----------------------------------------- -------- ----------------------------
PATH NOT NULL VARCHAR2(200)
IP NOT NULL VARCHAR2(15)
LOADTIME DATE
OWNER NOT NULL VARCHAR2(15)
SCORE integer
LOCKED NOT NULL CHAR(5)
TEST NUMBER(20)

SQL> alter table scott.pic drop column test;

Table altered.

SQL> desc scott.pic
Name Null? Type
----------------------------------------- -------- ----------------------------
PATH NOT NULL VARCHAR2(200)
IP NOT NULL VARCHAR2(15)
LOADTIME DATE
OWNER NOT NULL VARCHAR2(15)
SCORE integer
LOCKED NOT NULL CHAR(5)

SQL> alter system unquiesce ;

System altered.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\scott连上了

SQL> conn scott/oracle
Connected.[/size]
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论