當前位置:首頁 » 操作系統 » linuxoracle使用

linuxoracle使用

發布時間: 2022-12-16 15:20:08

❶ 在linux怎麼操控oracle建表

操作步驟如下: 1、登錄linux,以oracle用戶登錄(如果是root用戶登錄的,登錄後用 su - oracle命令切換成oracle用戶)
2、以sysdba方式來打開sqlplus,命令如下: sqlplus "/as sysdba"
3、查看我們常規將用戶表空間放置位置:執行如下sql:
select name from v$datafile;
上邊的sql一般就將你的用戶表空間文件位置查出來了。
4、創建用戶表空間:
CREATE TABLESPACE NOTIFYDB DATAFILE
'/oracle/oradata/test/notifydb.dbf' SIZE 200M AUTOEXTEND ON EXTENT
MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
5、創建用戶,指定密碼和上邊創建的用戶表空間
CREATE USER hc_notify IDENTIFIED BY hc_password DEFAULT TABLESPACE NOTIFYDB;
6、賦予許可權
grant connect,resource to hc_notify;
grant unlimited tablespace to hc_notify;
grant create database link to hc_notify;
grant select any sequence,create materialized view to hc_notify;
經過以上操作,我們就可以使用hc_notify/hc_password登錄指定的實例,創建我們自己的表了

❷ 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資料庫

啟動oracle資料庫步驟:
首先使用oracle用戶登錄Linux,然後在shell命令行中執行下面的命令:
第一步:打開Oracle監聽
$ lsnrctl start
第二步:進入sqlplus
$ sqlplus /nolog
SQL>
第三步:使用sysdab角色登錄sqlplus
SQL> conn /as sysdba
第四步:啟動資料庫
SQL> startup
經過上面的四個步驟,oracle資料庫就可以啟動了。
關閉資料庫用 shutdown 是要等待事物結束才關閉,強制關閉用 shutdown abort。

❹ 在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完整命令~第一次嘗試登陸~向各位求教~在線等!

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怎麼啟動

su - oracle

lsnrctl start

sqlplus / as sysdba

startup


詳細步驟如下:

1.進入到sqlplus啟動實例
[oracle@redhat~]$su-oracle--「切換到oracle用戶」
Password:
[oracle@redhat~]$lsnrctlstart--「打開監聽」
LSNRCTLforLinux:Version10.2.0.1.0-Proctionon14-OCT-200919:06:40
Copyright(c)1991,2005,Oracle.Allrightsreserved.
Starting/home/oracle/proct/10g/bin/tnslsnr:pleasewait...
TNSLSNRforLinux:Version10.2.0.1.0-Proction
Systemparameterfileis/home/oracle/proct/10g/network/admin/listener.ora
Logmessageswrittento/home/oracle/proct/10g/network/log/listener.log
Listeningon:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Listeningon:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUSoftheLISTENER
------------------------
AliasLISTENER
VersionTNSLSNRforLinux:Version10.2.0.1.0-Proction
StartDate14-OCT-200919:06:40
Uptime0days0hr.0min.0sec
TraceLeveloff
SecurityON:LocalOSAuthentication
SNMPOFF
ListenerParameterFile/home/oracle/proct/10g/network/admin/listener.ora
ListenerLogFile/home/oracle/proct/10g/network/log/listener.log
ListeningEndpointsSummary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
ServicesSummary...
Service"PLSExtProc"has1instance(s).
Instance"PLSExtProc",statusUNKNOWN,has1handler(s)forthisservice...

[oracle@redhat~]$sqlplus/nolog--「進入到sqlplus」
SQL*Plus:Release10.2.0.1.0-ProctiononWedOct1419:06:452009
Copyright(c)1982,2005,Oracle.Allrightsreserved.
SQL>conn/assysdba--「連接到sysdba」
Connectedtoanidleinstance.
SQL>startup--「啟動資料庫實例」
ORACLEinstancestarted.

FixedSize1218968bytes
VariableSize88082024bytes
DatabaseBuffers188743680bytes
RedoBuffers7168000bytes
Databasemounted.
Databaseopened.
SQL>shutdownimmediate--「關閉資料庫實例」
Databaseclosed.
Databasedismounted.
ORACLEinstanceshutdown.
SQL>exit
.2.0.1.0-Proction
WiththePartitioning,OLAPandDataMiningoptions
[oracle@redhat~]$lsnrctlstop--「關閉監聽」
LSNRCTLforLinux:Version10.2.0.1.0-Proctionon14-OCT-200919:08:06
Copyright(c)1991,2005,Oracle.Allrightsreserved.
Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))

❼ 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命令

  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執行sqlplus找不到

linux系統oracle執行sqlplus找不到是設置錯誤造成的,解決方法為:

1、將ORACLE客戶端rpm安裝包傳輸到linux系統。

熱點內容
安卓手機怎麼找微信隱藏對話 發布:2025-05-14 23:07:47 瀏覽:336
怎麼查看泰拉伺服器ip 發布:2025-05-14 23:03:29 瀏覽:72
c語言學生成績查詢系統 發布:2025-05-14 22:58:30 瀏覽:4
怎麼進別人的伺服器 發布:2025-05-14 22:45:55 瀏覽:772
用編程寫音樂 發布:2025-05-14 22:45:08 瀏覽:782
如何識別電腦的網路配置 發布:2025-05-14 22:38:46 瀏覽:847
pipforpython3 發布:2025-05-14 22:38:34 瀏覽:350
如何把迷你世界的伺服器搞崩 發布:2025-05-14 22:37:15 瀏覽:94
如何讓安卓卡死機 發布:2025-05-14 22:36:27 瀏覽:634
wemall微商城源碼 發布:2025-05-14 22:15:20 瀏覽:804