導航:首頁 > 程序命令 > 查看oracle表結構命令

查看oracle表結構命令

發布時間:2022-06-25 22:35:57

⑴ 如何查看oracle資料庫所有表結構圖

覺得你應該先弄清楚oracle的常規數據字典的結構,像9i里的常規數據字典中對象名稱就有以USER,ALL,DBA為前綴的對象。
以USER為例,我們查該對象下有些什麼表,就應該執行下列的語句:
SQL>select table_name from user_tables;
類似的,你可以進行替換。:)

如果你想查資料庫中所有的表的話,可以查詢
SELECT * FROM dba_tables

如果你想查詢資料庫中某個用戶下的表的話,也可以登錄這個用戶,再查詢:
SELECT * FROM USER_TABLES

要想導入外部sql語句可以用命令
sql >@e:\文件名.sql

如你想保存 select * from tablename;語句的結果,可以在sql*plus 裡面這樣:

SPOOL c:\test.sql //這是保存文件的位置
select * from tablename;
SPOOL OFF

⑵ oracle 查看錶結構,表裡的數據

1、首先,我們打開PLSQL工具連接到需要進行數據比對的ORACLE資料庫。

⑶ oracle 如何獲取表的結構,就像mysql里的desc命令一樣的功能,

一樣的,在command窗口或者
sqlplus

desc
table_name
如果要看create語句的話,估計還是要藉助工具了,否則比較難搞定。。

⑷ oracle怎麼通過sql查看錶的結構

分兩種方法:

1、在命令窗口通過如下語句:

desc表名;

⑸ 誰知道Oracle常用的命令如何查看錶的結構

EDITDATA 表名;修改表欄位:Alter table 表名 modify(欄位名 類型 約束);alter table test modify (addd varchar2(10) null); alter table 表名 add(欄位名 類型 約束);alter table test add(age varchar2(5)); 1.登陸系統用戶在Oracle常用命令中查看錶結構sqlplus 然後輸入系統用戶名和密碼登陸別的用戶conn 用戶名/密碼;2.創建表空間create tablespace 空間名 datafile 'c:\空間名' size 15M --表空間的存放路徑,初始值為15M autoExtend on next 10M --空間的自動增長的值是10M permanent online; --永久使用 3.創建用戶create user shi --創建用戶名為shi identified by scj --創建密碼為scj default tablespace 表空間名 --默認表空間名 temporary tablespace temp --臨時表空間為temp profile default --受profile文件的限制 quota unlimited on 表空間名; --在表空間下面建表不受限制 4.創建角色create role 角色名 identified by 密碼;5.給角色授權grant create session to 角色名;--給角色授予創建會話的許可權grant 角色名 to 用戶名; --把角色授予用戶6.給用戶授予許可權grant connect,resource to shi;--給shi用戶授予所有許可權 Grant dba to shi;-給shi 用戶授予DBA許可權 grant create table to shi; --給shi用戶授予創建表的許可權 7.select table_name from user_tables; 察看當前用戶下的所有表8.select tablespace_name from user_tablespaces; 察看當前用戶下的 表空間9.select username from dba_users;察看所有用戶名稱命令 必須用sys as sysdba登陸10.創建表create table 表名( id int not null, name varchar2(20) not null )tablespace 表空間名 --所屬的表空間 storage ( initial 64K --表的初始值 minextents 1 --最小擴展值 maxextents unlimited --最大擴展值 ); 11.為usrs表添加主鍵和索引alter table users add constraint pk primary key (ID); 12.為已經創建users表添加外鍵alter table users add constraint fk_roleid foreign key (roleid) references role(role_id) on delete cascad; --下邊寫主表的列 on delete cascad是創建級聯 13.把兩個列連接起來select concat(name,id) from 表名; --把name和id連接起來14.截取字元串select column(name,'李') from 表名;把name中的『李』去掉15.運行事務之前必須寫set serveroutput on; 打開輸入輸出(不寫的話,列印不出信息)16.while的應用declare --聲明部分 ccc number:=1; --復職 a number:=0; begin --事務的開始 while ccc<=100 loop --循環 if((ccc mod 3)=0) then --條件 dbms_output.put_line(ccc||','); --列印顯示 aa:=a+ccc; end if; --結束if cc:=ccc+1; end loop; --結束循環 dbms_output.put_line(a); end; --結束事務 / 17.select into 的用法 --只能處理一行結果集declare name varchar(30); begin select username into name from users where id=2; dbms_output.put_line('姓名為:'||name); end; / 上述的相關內容就是對Oracle常用命令中查看錶結構的描述,希望會給你帶來一些幫助在此方面。

⑹ oracle資料庫的常見命令

1、su – oracle 不是必需,適合於沒有DBA密碼時使用,可以不用密碼來進入sqlplus界面

2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/manager@ora9i

3、SQL>connect / as sysdba ;(as sysoper)或connect internal/oracle AS SYSDBA (scott/tiger)conn sys/change_on_install as sysdba

4、SQL>startup; 啟動資料庫實例

5、 查看當前的所有資料庫: select * from v$database

(6)查看oracle表結構命令擴展閱讀:

ORACLE資料庫系統是美國ORACLE公司(甲骨文)提供的以分布式資料庫為核心的一組軟體產品,是目前最流行的客戶/伺服器(CLIENT/SERVER)或B/S體系結構的資料庫之一。

oracle資料庫邏輯結構

它由至少一個表空間和資料庫模式對象組成。這里,模式是對象的集合,而模式對象是直接引用資料庫數據的邏輯結構。

模式對象包括這樣一些結構:表、視圖、序列、存儲過程、同義詞、索引、簇和資料庫鏈等。邏輯存儲結構包括表空間、段和范圍,用於描述怎樣使用資料庫的物理空間。

文件結構

資料庫的物理存儲結構是由一些多種物理文件組成,主要有數據文件、控制文件、重做日誌文件、歸檔日誌文件、參數文件、口令文件、警告文件等。

⑺ Oracle常用的命令如何查看錶的結構

以下的文章主要是介紹Oracle常用的命令中如何查看錶的結構,如果你對Oracle常用的命令中如何查看錶的結構的這一實際操作方案感興趣的話,你就可以瀏覽以下的文章對其有一個更好的了解。EDITDATA 表名;修改表欄位:Alter table 表名 modify(欄位名 類型 約束);alter table test modify (addd varchar2(10) null); alter table 表名 add(欄位名 類型 約束);alter table test add(age varchar2(5)); 1.登陸系統用戶在Oracle常用命令中查看錶結構sqlplus 然後輸入系統用戶名和密碼登陸別的用戶conn 用戶名/密碼;2.創建表空間create tablespace 空間名 datafile 'c:\空間名' size 15M --表空間的存放路徑,初始值為15M autoExtend on next 10M --空間的自動增長的值是10M permanent online; --永久使用 3.創建用戶create user shi --創建用戶名為shi identified by scj --創建密碼為scj default tablespace 表空間名 --默認表空間名 temporary tablespace temp --臨時表空間為temp profile default --受profile文件的限制 quota unlimited on 表空間名; --在表空間下面建表不受限制 4.創建角色create role 角色名 identified by 密碼;5.給角色授權grant create session to 角色名;--給角色授予創建會話的許可權grant 角色名 to 用戶名; --把角色授予用戶6.給用戶授予許可權grant connect,resource to shi;--給shi用戶授予所有許可權 Grant dba to shi;-給shi 用戶授予DBA許可權 grant create table to shi; --給shi用戶授予創建表的許可權 7.select table_name from user_tables; 察看當前用戶下的所有表8.select tablespace_name from user_tablespaces; 察看當前用戶下的 表空間9.select username from dba_users;察看所有用戶名稱命令 必須用sys as sysdba登陸10.創建表create table 表名( id int not null, name varchar2(20) not null )tablespace 表空間名 --所屬的表空間 storage ( initial 64K --表的初始值 minextents 1 --最小擴展值 maxextents unlimited --最大擴展值 ); 11.為usrs表添加主鍵和索引alter table users add constraint pk primary key (ID); 12.為已經創建users表添加外鍵alter table users add constraint fk_roleid foreign key (roleid) references role(role_id) on delete cascad; --下邊寫主表的列 on delete cascad是創建級聯 13.把兩個列連接起來select concat(name,id) from 表名; --把name和id連接起來14.截取字元串select column(name,'李') from 表名;把name中的『李』去掉15.運行事務之前必須寫set serveroutput on; 打開輸入輸出(不寫的話,列印不出信息)16.while的應用declare --聲明部分 ccc number:=1; --復職 a number:=0; begin --事務的開始 while ccc<=100 loop --循環 if((ccc mod 3)=0) then --條件 dbms_output.put_line(ccc||','); --列印顯示 aa:=a+ccc; end if; --結束if cc:=ccc+1; end loop; --結束循環 dbms_output.put_line(a); end; --結束事務 / 17.select into 的用法 --只能處理一行結果集declare name varchar(30); begin select username into name from users where id=2; dbms_output.put_line('姓名為:'||name); end; / 上述的相關內容就是對Oracle常用命令中查看錶結構的描述,希望會給你帶來一些幫助在此方面。

⑻ 如何獲取oracle系統表表結構

1、使用plsql developer 工具是可以直接看到的 2、使用describe table_name;命令(table_name為表名)

⑼ 查看Oracle表結構

1)user_tables,顯示當前用戶擁有的所有表:
select table_name from user_tables;
2)all_tables,顯示當前用戶可以訪問的所有表,包含其它人授權訪問的表:
select table_name from all_tables;
3)dba_tables,顯示資料庫所有表,需dba許可權:
select table_name from dba_tables;

閱讀全文

與查看oracle表結構命令相關的資料

熱點內容
滿青十大酷型電影 瀏覽:433
dayz進不了伺服器怎麼辦 瀏覽:386
安卓usbdac怎麼使用 瀏覽:939
法國小女生電影 瀏覽:307
反編譯本地運算游戲 瀏覽:566
阿里雲伺服器被攻擊了多久恢復 瀏覽:293
我的孝順女兒電影 瀏覽:597
翠微居txt下載 瀏覽:394
tom快播 瀏覽:662
換硬幣演算法遞歸 瀏覽:122
四級電影推薦 瀏覽:847
女主手臂處有射精管理局臂章的電影 瀏覽:328
從哪找韓國電影 瀏覽:313
pdf轉換成ppt如何轉換 瀏覽:146
國內越南戰爭的電影 瀏覽:246
台灣好看的倫理電影 瀏覽:525
外遇的妻子2李采潭 瀏覽:954
365電影網站免費 瀏覽:785
網頁看電影不卡的網站 瀏覽:528
山西壓縮天然氣集團晉城有限公司 瀏覽:732