OTN Japan - はじめてのOracle9iデータベース:バックアップ・リカバリを体験しよう
Backup
バックアップの対象となるデータファイル・制御ファイルを把握します。また、ローカル管理の一時表領域に関しては、別に確認します。
sqlplus “/as sysdba”
SQL# select name from v$datafile;
SQL# select name from v$controlfile;
SQL# select bytes, name from v$tempfile;
SQL# shutdown immediate;
ファイルをコピーします。
% mkdir /home1/ora920/app/oracle/backup
% cd /home1/ora920/app/oracle/oradata/ora920/
% cp system01.dbf /home1/ora920/app/oracle/backup
(以下同様に繰り返し)
Restore
SQL# shutdown
SQL# exit
% cp /backup/* /home1/ora920/app/oracle/oradata/ora920/
% sqlplus “/as sysdba”
SQL# startup mount
SQL# recover database until cancel;
メディア・リカバリが完了しました。
SQL# alter database open resetlogs;
(REDOログのサイズによっては起動するまでに少し時間がかかります。)
SQL# alter database tempfile
‘/home1/ora920/app/oracle/oradata/ora920/temp01.dbf’ drop;
SQL# alter tablespace temp add tempfile
'/home1/ora920/app/oracle/oradata/ora920/temp01.dbf' reuse;
もしくはファイルが存在しない場合は、
SQL# alter tablespace temp add tempfile
'/home1/ora920/app/oracle/oradata/ora920/temp01.dbf' <ファイルサイズ>;
Backup
バックアップの対象となるデータファイル・制御ファイルを把握します。また、ローカル管理の一時表領域に関しては、別に確認します。
sqlplus “/as sysdba”
SQL# select name from v$datafile;
SQL# select name from v$controlfile;
SQL# select bytes, name from v$tempfile;
SQL# shutdown immediate;
ファイルをコピーします。
% mkdir /home1/ora920/app/oracle/backup
% cd /home1/ora920/app/oracle/oradata/ora920/
% cp system01.dbf /home1/ora920/app/oracle/backup
(以下同様に繰り返し)
Restore
SQL# shutdown
SQL# exit
% cp /backup/* /home1/ora920/app/oracle/oradata/ora920/
% sqlplus “/as sysdba”
SQL# startup mount
SQL# recover database until cancel;
メディア・リカバリが完了しました。
SQL# alter database open resetlogs;
(REDOログのサイズによっては起動するまでに少し時間がかかります。)
SQL# alter database tempfile
‘/home1/ora920/app/oracle/oradata/ora920/temp01.dbf’ drop;
SQL# alter tablespace temp add tempfile
'/home1/ora920/app/oracle/oradata/ora920/temp01.dbf' reuse;
もしくはファイルが存在しない場合は、
SQL# alter tablespace temp add tempfile
'/home1/ora920/app/oracle/oradata/ora920/temp01.dbf' <ファイルサイズ>;
教えて! Watch キャラクタ・セットの確認方法
NLS 関連初期化パラメータ(NLS 環境変数)
select * from nls_database_parameters
where parameter ='NLS_CHARACTERSET';
select * from v$nls_parameters;
Character Set Migration
ALTER DATABASE CHARACTER SET AL32UTF8;
NLS 関連初期化パラメータ(NLS 環境変数)
select * from nls_database_parameters
where parameter ='NLS_CHARACTERSET';
select * from v$nls_parameters;
Character Set Migration
ALTER DATABASE CHARACTER SET AL32UTF8;
08/13: MSSQL > Statistics
CREATE STATISTICS [name] ON [table name(column name] WITH SAMPLE 50 PERSENT
ALTER DATABASE [database name] SET AUTO_CREATE_STATISTICS ON
dbcc show_statistics (table_name, stat_name)
ALTER DATABASE [database name] SET AUTO_CREATE_STATISTICS ON
dbcc show_statistics (table_name, stat_name)
08/12: oracle sys system difference
Oracle
SYS owns the data dictionary
SYS has the SYSDBA privilege which SYSTEM doesn't
Note, SYSDBA is not a role, it is a privilege. You'll find it in system_privilege_map, not in dba_roles.
SYS owns the data dictionary
SYS has the SYSDBA privilege which SYSTEM doesn't
Note, SYSDBA is not a role, it is a privilege. You'll find it in system_privilege_map, not in dba_roles.
08/12: Install Oracle 9i on Windows
Installing Oracle 9i on Windows 2000
Pretty straight forward.
Note the last one OracleServerORCL is the actual database process itself. OracleOraHome90TNSListener is the listener process for remote connections to the database. OracleOraHome90Agent is the Oracle Agent used to communicate with management services. Finally, the OracleOraHome90HTTPServer is the Oracle/Apache web server.
Pretty straight forward.
Note the last one OracleServerORCL is the actual database process itself. OracleOraHome90TNSListener is the listener process for remote connections to the database. OracleOraHome90Agent is the Oracle Agent used to communicate with management services. Finally, the OracleOraHome90HTTPServer is the Oracle/Apache web server.