當前位置:首頁 » 操作系統 » oracle命令linux

oracle命令linux

發布時間: 2022-05-27 07:32:54

⑴ 怎麼在linux中操作oracle資料庫

我用的是redhat
linux,用下面的步驟來啟動oracle資料庫。
首先使用oracle用戶登錄linux,然後在shell命令行中執行下面的命令:
第一步:打開oracle監聽
$
lsnrctl
start
第二步:進入sqlplus
$
sqlplus
/nolog
sql>
第三步:使用sysdab角色登錄sqlplus
sql>
conn
/as
sysdba
第四步:啟動資料庫
sql>
startup
經過上面的四個步驟,oracle資料庫就可以啟動了。

⑵ linux怎麼進入oracle命令

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

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

  3. root用戶登錄linux桌面右擊>open terminal# su - oracle$ sqlplus /nologSQL> conn / as sysdbaSQL>startupSQL>select sysdate from al;之後你就可以使用oracle了。

⑶ linux怎麼進入oracle命令

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

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

  3. root用戶登錄linux桌面右擊>open terminal# su - oracle$ sqlplus /nologSQL> conn / as sysdbaSQL>startupSQL>select sysdate from al;之後你就可以使用oracle了。

⑷ linux怎麼查看oracle版本

linux查看oracle版本步驟如下:

1、首先登陸您的Linux伺服器(本伺服器已經安裝了Oracle)。

⑸ linux下怎麼啟動oracle資料庫,命令是什麼

啟動oracle資料庫步驟:
首先使用oracle用戶登錄Linux,然後在shell命令行中執行下面的命令:
第一步:打開Oracle監聽
$ lsnrctl start
第二步:進入sqlplus
$ sqlplus /nolog
SQL>
第三步:使用sysdab角色登錄sqlplus
SQL> conn /as sysdba
第四步:啟動資料庫
SQL> startup

經過上面的四個步驟,oracle資料庫就可以啟動了。
關閉資料庫用 shutdown 是要等待事物結束才關閉
強制關閉用 shutdown abort

⑹ oracle linux怎麼用

linux下 oracle常用命令
打開圖形化窗口:
1)Database Configuration Assistant windows (添加資料庫實例)
$ dbca
2)Oracle Net Configuration Assistant windows (配置監聽)
$ netca
3)打開EM
$ oemapp dbastudio (打開企業管理器圖形界面)
$ opemapp console (打開企業管理器圖形界面(和上面的命令效果一樣))

常用命令:
$ lsnrctl start|stop|status (啟動|停止|活動狀態 監聽)
$ isqlplusctl start|stop (啟動|停止 isqlplus 可以在瀏覽器登錄 5560埠)
$ sqlplus /nolog (以不連接資料庫的方式啟動sqlplus)
$ sqlplus system/manager @ file.sql (執行sql腳本文件)
$ sqlplus system/manager (使用system用戶登錄sqlplus)
$ imp system/manager file=/tmp/expfile.dmp log=/tmp/implogfile.log ignore=y fromuser=expuser touser=impuser (用戶模式表數據導入,如果沒有特別指定值,就使用默認的值)
$ exp username/password file=/tmp/expfile.dmp log=/tmp/proV114_exp.log (用戶模式表數據導出,這是最簡單的導出方法)

SQL> conn / as sysdba (以sysdba用戶連接)
SQL> startup
SQL> shutdown
SQL> shutdown immediate (立即關閉實例)
SQL> desc dba_users; (查詢dba_users表結構)
SQL> select username from dba_users; (查詢當前sid下的所有用戶的username)
SQL> select count(*) from username.tablename; (查詢tablename表的行數)
SQL> drop user username cascade; (刪除名稱為username的oracle用戶)
SQL> select distinct table_name from user_tab_columns; (查看當前user模式下所有表名)

一、ORACLE的啟動和關閉
1、在單機環境下
要想啟動或關閉ORACLE系統必須首先切換到ORACLE用戶,如下
su - oracle

a、啟動ORACLE系統
oracle>svrmgrl
SVRMGR>connect internal
SVRMGR>startup
SVRMGR>quit

a、啟動ORACLE系統
oracle>svrmgrl
SVRMGR>connect internal
SVRMGR>startup
SVRMGR>quit

2、在雙機環境下
要想啟動或關閉ORACLE系統必須首先切換到root用戶,如下
su - root

a、啟動ORACLE系統
hareg -y oracle

b、關閉ORACLE系統
hareg -n oracle

Oracle資料庫有哪幾種啟動方式

說明:

有以下幾種啟動方式:
1、startup nomount
非安裝啟動,這種方式啟動下可執行:重建控制文件、重建資料庫

讀取init.ora文件,啟動instance,即啟動SGA和後台進程,這種啟動只需要init.ora文件

2、startup mount dbname
安裝啟動,這種方式啟動下可執行:
資料庫日誌歸檔、
資料庫介質恢復、
使數據文件聯機或離線,
重新定位數據文件、重做日誌文件。

執行「nomount」,然後打開控制文件,確認數據文件和聯機日誌文件的位置,
但此時不對數據文件和日誌文件進行校驗檢查。

3、startup open dbname
先執行「nomount」,然後執行「mount」,再打開包括Redo log文件在內的所有資料庫文件,
這種方式下可訪問資料庫中的數據。

4、startup,等於以下三個命令
startup nomount
alter database mount
alter database open

5、startup restrict
約束方式啟動
這種方式能夠啟動資料庫,但只允許具有一定特權的用戶訪問
非特權用戶訪問時,會出現以下提示:
ERROR:
ORA-01035: ORACLE 只允許具有 RESTRICTED SESSION 許可權的用戶使用

6、startup force
強制啟動方式
當不能關閉資料庫時,可以用startup force來完成資料庫的關閉
先關閉資料庫,再執行正常啟動資料庫命令

7、startup pfile=參數文件名
帶初始化參數文件的啟動方式
先讀取參數文件,再按參數文件中的設置啟動資料庫
例:startup pfile=E:Oracleadminoradbpfileinit.ora

8、startup EXCLUSIVE
二、用戶如何有效地利用數據字典
ORACLE的數據字典是資料庫的重要組成部分之一,它隨著資料庫的產生而產生, 隨著資料庫的變化而變化,
體現為sys用戶下的一些表和視圖。數據字典名稱是大寫的英文字元。

數據字典里存有用戶信息、用戶的許可權信息、所有數據對象信息、表的約束條件、統計分析資料庫的視圖等。
我們不能手工修改數據字典里的信息。

很多時候,一般的ORACLE用戶不知道如何有效地利用它。

dictionary 全部數據字典表的名稱和解釋,它有一個同義詞dict
dict_column 全部數據字典表裡欄位名稱和解釋

如果我們想查詢跟索引有關的數據字典時,可以用下面這條SQL語句:

SQL>select column_name,comments from dict_columns where table_name='USER_INDEXES';

依此類推,就可以輕松知道數據字典的詳細名稱和解釋,不用查看ORACLE的其它文檔資料了。

下面按類別列出一些ORACLE用戶常用數據字典的查詢使用方法。

1、用戶

查看當前用戶的預設表空間
SQL>select username,default_tablespace from user_users;

查看當前用戶的角色
SQL>select * from user_role_privs;

查看當前用戶的系統許可權和表級許可權
SQL>select * from user_sys_privs;
SQL>select * from user_tab_privs;

2、表

查看用戶下所有的表
SQL>select * from user_tables;

查看名稱包含log字元的表
SQL>select object_name,object_id from user_objects
where instr(object_name,'LOG')>0;

查看某表的創建時間
SQL>select object_name,created from user_objects where object_name=upper('&table_name');

查看某表的大小
SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
where segment_name=upper('&table_name');

查看放在ORACLE的內存區里的表
SQL>select table_name,cache from user_tables where instr(cache,'Y')>0;

3、索引

查看索引個數和類別
SQL>select index_name,index_type,table_name from user_indexes order by table_name;

查看索引被索引的欄位
SQL>select * from user_ind_columns where index_name=upper('&index_name');

查看索引的大小
SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
where segment_name=upper('&index_name');

4、序列號

查看序列號,last_number是當前值
SQL>select * from user_sequences;

5、視圖

查看視圖的名稱
SQL>select view_name from user_views;

查看創建視圖的select語句
SQL>set view_name,text_length from user_views;
SQL>set long 2000; 說明:可以根據視圖的text_length值設定set long 的大小
SQL>select text from user_views where view_name=upper('&view_name');

6、同義詞

查看同義詞的名稱
SQL>select * from user_synonyms;

7、約束條件

查看某表的約束條件
SQL>select constraint_name, constraint_type,search_condition, r_constraint_name
from user_constraints where table_name = upper('&table_name');

SQL>select c.constraint_name,c.constraint_type,cc.column_name
from user_constraints c,user_cons_columns cc
where c.owner = upper('&table_owner') and c.table_name = upper('&table_name')
and c.owner = cc.owner and c.constraint_name = cc.constraint_name
order by cc.position;

8、存儲函數和過程

查看函數和過程的狀態
SQL>select object_name,status from user_objects where object_type='FUNCTION';
SQL>select object_name,status from user_objects where object_type='PROCEDURE';

查看函數和過程的源代碼
SQL>select text from all_source where owner=user and name=upper('&plsql_name');

三、查看資料庫的SQL
1、查看錶空間的名稱及大小

select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;

2、查看錶空間物理文件的名稱及大小

select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;

3、查看回滾段名稱及大小

select segment_name, tablespace_name, r.status,
(initial_extent/1024) InitialExtent,(next_extent/1024) NextExtent,
max_extents, v.curext CurExtent
From dba_rollback_segs r, v$ro

⑺ linux怎麼查看oracle安裝路徑

使用whereis oracle命令可以查詢oracle的安裝路徑,具體使用步驟如下:

1、首先,用XSell工具連接相應linux主機,進入到linux命令行狀態下,等待輸入shell指令。

⑻ linux開啟oracle服務命令是什麼

如果你的oracle安裝和配置都沒有問題的話:

#su - oracle

$sqlplus / as sysdba

>startup

>exit

$lsnrctl start

$ps -ef|grep oracle

⑼ 求linux 進入oracle完整命令~第一次嘗試登陸~向各位求教~在線等!

su - oracle
sqlplus /nolog
connect /as sysdba

詳細步驟:

oracle資料庫是目前最流行的伺服器資料庫之一,能夠事項分布式處理功能,那麼Linux伺服器要如何啟動oracle資料庫呢?下面小編就給大家介紹下Linux使用命令啟動oracle資料庫的步驟,一起來了解下吧。

首先使用oracle用戶登錄Linux,然後在shell命令行中執行下面的命令:

第一步:打開Oracle監聽

$ lsnrctl start

第二步:進入sqlplus

$ sqlplus /nolog

SQL》

第三步:使用sysdab角色登錄sqlplus

SQL》 conn /as sysdba

第四步:啟動資料庫

SQL》 startup

⑽ 怎麼用linux命令連接racle資料庫

可以通過SSH或者SecureCRTPortable等可以直接連接Linux操作系統的軟體,連接到Linux系統。下面具體介紹一下:

1、登錄到Linux後,就可以在命令窗口直接對Linux進行操作了。先將用戶切換到Oracle。當顯示為[oracle@db ~]$ 時,說明切換成功。命令:su - oracle;

2、切換到Oracle用戶之後,我們登錄到到sqlplus,使用dba許可權登錄到sqlplus。在sqlplus中,我們使用conn連接一下我們具體想要操作的資料庫用戶。命令:conn username/password,示connected表示連接成功;

3、在SQL>中輸入想要進行操作的sql語句,這里我們舉個簡單的例子,以一個單表查詢為例進行演示:sql語句:select * from tablename。

(10)oracle命令linux擴展閱讀:

Linux是一套免費使用和自由傳播的類Unix操作系統,是一個基於POSIX和UNIX的多用戶、多任務、支持多線程和多CPU的操作系統。它能運行主要的UNIX工具軟體、應用程序和網路協議。它支持32位和64位硬體。Linux繼承了Unix以網路為核心的設計思想,是一個性能穩定的多用戶網路操作系統。

Linux操作系統誕生於1991 年10 月5 日(這是第一次正式向外公布時間)。Linux存在著許多不同的Linux版本,但它們都使用了Linux內核。Linux可安裝在各種計算機硬體設備中,比如手機、平板電腦、路由器、視頻游戲控制台、台式計算機、大型機和超級計算機。

參考資料:Linux-網路

熱點內容
qq怎麼上傳相冊圖片 發布:2024-10-27 22:53:21 瀏覽:814
差額及演算法 發布:2024-10-27 22:36:44 瀏覽:290
解壓番茄球有毒嗎 發布:2024-10-27 22:36:43 瀏覽:861
動態密碼在哪裡獲得 發布:2024-10-27 22:36:42 瀏覽:183
ios9照片加密 發布:2024-10-27 22:18:29 瀏覽:49
pythonyaml安裝 發布:2024-10-27 22:06:32 瀏覽:585
php5升級到php7 發布:2024-10-27 21:46:06 瀏覽:737
安卓機都在哪裡下載游戲 發布:2024-10-27 21:23:57 瀏覽:647
伺服器里的視頻怎麼做成鏈接 發布:2024-10-27 21:23:19 瀏覽:383
資料庫還原出錯 發布:2024-10-27 21:23:14 瀏覽:379