忍者ブログ
株のポジショントレード(数週間~数ヵ月)、ブックビルディングの記録。でしたが、今はoracleの備忘録。
2025-061 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 prev 05 next 07
57  56  55  54  53  52  51  50  49  48  47 
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

SELinux.jpg・OSデフォルトインストールだと、SELinuxが有効に設定される。(多分)
→そのままだとsqlplusが実行できない。
→SELinuxを無効にすると、sqlplusコマンドが実行可能になる。




・とりあえず、ORACLE_SIDは.bash_profileへは入れずに、手打ちにしておくことに。

[oracle@localhost ~]$ export ORACLE_SID=orcl111
[oracle@localhost ~]$ printenv ORACLE_SID
orcl111
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on 日 11月 15 02:02:17 2009

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

アイドル・インスタンスに接続しました。

SQL> startup nomount
ORACLEインスタンスが起動しました。

Total System Global Area 2042241024 bytes
Fixed Size                  1314408 bytes
Variable Size             486539672 bytes
Database Buffers         1543503872 bytes
Redo Buffers               10883072 bytes
SQL>
SQL> select instance_name from v$instance;

INSTANCE_NAME
------------------------------------------------
orcl111

SQL> select version from v$instance;

VERSION
---------------------------------------------------
11.1.0.7.0

SQL> select version from v$timezone_file;

   VERSION
----------
         4

SQL>

・ORAエラーが文字化けする時は、とりあえずNLS_LANGを"American_America.〜"にすればよい?
(追記:黒本Expert[Oracle on Linux]のP273に書いてあった。→mountモードに進めていない時、日本語環境では文字化けが起こる。oerrコマンドでエラーメッセージの原文と原因、対処方法を表示できる。例:SQL> !oerr ora 205)

SQL> select * from NLS_DATABASE_PARAMETERS where PARAMETER = 'NLS_NCHAR_CHARACTERSET';
select * from NLS_DATABASE_PARAMETERS where PARAMETER = 'NLS_NCHAR_CHARACTERSET'
              *
行1でエラーが発生しました。:
ORA-01219: ?????????????????: ????/????????????????


SQL> exit
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsとの接続が切断されました。
[oracle@localhost scripts]$ printenv NLS_LANG
Japanese_Japan.AL32UTF8
[oracle@localhost scripts]$ export NLS_LANG=American_America.AL32UTF8
[oracle@localhost scripts]$ printenv NLS_LANG
American_America.AL32UTF8
[oracle@localhost scripts]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Sun Nov 15 17:33:29 2009

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from NLS_DATABASE_PARAMETERS where PARAMETER = 'NLS_NCHAR_CHARACTERSET';
select * from NLS_DATABASE_PARAMETERS where PARAMETER = 'NLS_NCHAR_CHARACTERSET'
              *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only


SQL>

・停止→nomount→mount→openにおける現在位置確認?

SQL> startup nomount
ORACLEインスタンスが起動しました。

Total System Global Area 2042241024 bytes
Fixed Size                  1314408 bytes
Variable Size             486539672 bytes
Database Buffers         1543503872 bytes
Redo Buffers               10883072 bytes
SQL>
SQL> select status from v$instance;

STATUS
------------------------------------
STARTED

SQL> select * from v$database;
select * from v$database
              *
ERROR at line 1:
ORA-01507: database not mounted


SQL> select * from v$dba_tables;
select * from v$dba_tables
              *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only


SQL> alter database mount;

Database altered.

SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> select open_mode from v$database;

OPEN_MODE
----------
MOUNTED

SQL> alter database open;

Database altered.

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE

SQL> select count(*) from dba_tables;

  COUNT(*)
----------
      2495

SQL> select name, status from v$datafile;

NAME
--------------------------------------------------------------------------------
STATUS
-------
/u01/app/oracle/oradata/orcl111/system01.dbf
SYSTEM

/u01/app/oracle/oradata/orcl111/sysaux01.dbf
ONLINE

/u01/app/oracle/oradata/orcl111/undotbs01.dbf
ONLINE


NAME
--------------------------------------------------------------------------------
STATUS
-------
/u01/app/oracle/oradata/orcl111/users01.dbf
ONLINE


SQL>

・sqlplusからのsqlファイル実行は、@〜。sqlplusからのOSコマンド実行は、!〜。

SQL> @$ORACLE_HOME/ccr/admin/scripts/dropocm.sql
No previous OCM schema to drop.

PL/SQL procedure successfully completed.

SQL> !pwd
/u01/app/oracle/product/11.1.0/db_1/ccr/admin/scripts

SQL>

・ソフトウェアのアンインストール中などにおいては、カレントディレクトリが作業中に削除されてしまうことがある。それでもそのディレクトリにいることにはなっている。その場合、ディレクトリ移動をせずにdbcaコマンド等をうってもエラーとなってしまうので注意。

[oracle@localhost scripts]$ dbca
shell-init: error retrieving current directory: getcwd: cannot access parent directories: そのようなファイルやディレクトリはありません
Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.
[oracle@localhost scripts]$ cd
[oracle@localhost ~]$ dbca(→正常にdbcaが起動した。)


PR
NAME
TITLE
COLOR
MAIL
URL
COMMENT
EMOJI
Vodafone絵文字 i-mode絵文字 Ezweb絵文字
PASS
TRACKBACK URL 
カレンダー
05 2025/06 07
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
最新コメント
最新トラックバック
プロフィール
HN:
fool
性別:
男性
職業:
会社員
自己紹介:
・国内現物&信用取引の株式のみ。
----------
・株を始めた日:2001/03/16
・〜2004年:収支が±20万の間を動いただけ。
・2005年1月より本を購入する等して再スタート。
・2005年5月よりブックビルディングに参加。
・2009年夏、トータルでマイナスになり、休止。
・過程に満足せず、結果を出すことが目標。
バーコード
ブログ内検索
"fool" WROTE ALL ARTICLES.
PRODUCED BY SHINOBI.JP @ SAMURAI FACTORY INC.
忍者ブログ [PR]