可以通過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。
(1)linux如何使用oracle擴展閱讀:
Linux是一套免費使用和自由傳播的類Unix操作系統,是一個基於POSIX和UNIX的多用戶、多任務、支持多線程和多CPU的操作系統。它能運行主要的UNIX工具軟體、應用程序和網路協議。它支持32位和64位硬體。Linux繼承了Unix以網路為核心的設計思想,是一個性能穩定的多用戶網路操作系統。
Linux操作系統誕生於1991 年10 月5 日(這是第一次正式向外公布時間)。Linux存在著許多不同的Linux版本,但它們都使用了Linux內核。Linux可安裝在各種計算機硬體設備中,比如手機、平板電腦、路由器、視頻游戲控制台、台式計算機、大型機和超級計算機。
參考資料:Linux-網路
❷ 在Linux下安裝完Oracle10g,該怎麼用
1、裝完了就已經有資料庫了。
2、用linux的oracle用戶登陸到圖形界面系統
3、打開一個終端
4、在終端裡面敲下面的命令啟動資料庫
1)sqlplus
/
as
sysdba
2)startup
5、再開一個終端,敲入如下命令啟動監聽和oem
1)啟動監聽
lsnrctl
start
2)啟動oem服務
emctl
start
注意oem服務啟動後會有一個網址的提示,利用這個網址就可以通過ie用圖形界面操作oracle了
順序不要錯了,錯了會有問題。
❸ linux 怎麼開oracle
Linux下oracle資料庫啟動和關閉操作
第一步:登陸
root登陸之後切換到oracle用戶上,輸入
su oracle
第二步:連接
在oracle用戶下,輸入
sqlplus /nolog
第三步:使用管理員許可權
輸入
connect /as sysdba
第四步:啟動/關閉服務
輸入
startup
startup參數
不帶參數,啟動資料庫實例並打開資料庫,以便用戶使用資料庫,在多數情況下,使用這種方式!
nomount,只啟動資料庫實例,但不打開資料庫,在你希望創建一個新的資料庫時使用,或者在你需要這樣的時候使用!
mount,在進行資料庫更名的時候採用。這個時候資料庫就打開並可以使用了!
謝謝!不準確的地方請指教!
shutdown
shutdown的參數
Normal 需要等待所有的用戶斷開連接
Immediate 等待用戶完成當前的語句
Transactional 等待用戶完成當前的事務
Abort 不做任何等待,直接關閉資料庫
normal需要在所有連接用戶斷開後才執行關閉資料庫任務,所以有的時候看起來好象命令沒有運行一樣!在執行這個命令後不允許新的連接
immediate在用戶執行完正在執行的語句後就斷開用戶連接,並不允許新用戶連接。
transactional 在擁護執行完當前事物後斷開連接,並不允許新的用戶連接資料庫。
abort 執行強行斷開連接並直接關閉資料庫。
第五步:如果是啟動服務,要開啟監聽
退出sqlplus模式,輸入
lsnrctl start
❹ 怎麼在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,啟動資料庫監聽。
❻ 求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下安裝了Oracle怎麼開啟
工具:sqlplus
打開Linux字元集界面,登錄Oracle用戶
啟動監聽:lsnrctl start
sqlplus / as sysdba(注意空格)
當現實已連接時,輸入startup回車
select status from v$instance;查看是不是OPEN,如果是,此時說明資料庫已經開啟。
❽ 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
對於LINUX 操作系統 有很多技術知識是我們需要學習的。這里我就給大家介紹Linux中設置oracle開機自動啟動的 方法 。一起來看看吧。
Linux中設置oracle開機自動啟動的方法
在terminal中切換到root用戶
查看/etc/oratab文件的內容,其內容如下
[root@golonglee ~]# cat /etc/oratab | grep -v ^$
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N
使用命令vi /etc/oratab編輯文件/etc/oratab,在最後添加如下內容
##### what I have written is as following
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:Y
#####Finished wrote in 2015-12-24
說明:/home/oracle/app/oracle/proct/11.2.0/dbhome_1為oracle的安裝目錄,要根據實際情況進行修改。
(注意:圖中我用紅色標記的N要改成Y)
找到最後的內容
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N
復制該行oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N並注釋掉
粘貼該行,並將該行
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N最後的N
改為Y
最後按2次ESC鍵,並輸入:wq並按下enter保存,退出
使用命令vi /etc/rc.d/rc.local編輯rc.local文件,添加如下內容
##### what I have written is as following
su oracle -lc "/home/oracle/app/oracle/proct/11.2.0/dbhome_1/bin/lsnrctl start"
su oracle -lc /home/oracle/app/oracle/proct/11.2.0/dbhome_1/bin/dbstart
#####Finished wrote in 2015-12-24
說明:因為第一行命令中有空格所以用雙引號(英文的雙引號)
/home/oracle/app/oracle/proct/11.2.0/dbhome_1為oracle的安裝目錄,要根據實際情況進行修改。
最後按2次ESC鍵,並輸入:wq並按下enter保存,退出,重啟機器,驗證成功。
是不是很簡單呢~快跟著我一起學習吧!!!如果覺得這篇 文章 不錯的話就給我點一個贊吧。