oGIGIEo 的个人资料..**..**..**..(o'GIGIE'o...照片日志列表 工具 帮助

BJ-090 / IUP-001 oGIGIEo

...
第 1 张,共 4 张
更多相册 (30)
列表
尚未添加列表。

..**..**..**..(o'GIGIE'o)..**..**..**..

I love Christina Aguilera :: Aguilera is the best
10月11日

aix ไม่แก้ Asynchonize mode มาให้ (error libc.a)

CAUSE

Your operating system does not have the AIO configured or enabled.


SOLUTION

Note: The following commands must be run as user root.

1. Determine the state of the aio0 driver. Run the following AIX command:
    lsdev -C -l aio0
    Example output:
      aio0 Defined Asynchronous I/O

"Defined" indicates that the aio0 driver is installed on the system, but not available for applications to use. If the driver is not available for applications, change the state of the aio0 driver from "Defined" to "Available",


2. Run the cfgmgr AIX command:
    cfgmgr -l aio0


3. To make the "Available" state permanent (across system reboots), issue the chdev AIX command.
No system reboot is needed for these changes to take effect.
    chdev -l aio0 -P -a autoconfig='available'

    Example output:
      aio0 changed


4. Run the following command to check the state of the aio0 driver:
    lsdev -C -l aio0


    Example output:
      aio0 Available Asynchronous I/O

แก้ error ip เพี้ยน เข้า gui ไม่ได้

ถ้าเครื่อง AIX เวลา set ip ใช้คำสั่ง
ifconfig -a ไว้ดู
จากนั้นก้อใช้ ifconfig เปี่ยน ip
แต่ว่า ip ที่ได้กลับไม่ถาวร
ดังนั้น smitty ดีที่สุด
แต่ถ้าเปลี่ยนด้วย ifconfig แร้วไป restart ก็ให้เข้า command mode โดย
เลือก failsafe session from the login screen's option menu แร้ว login เข้าปกติ
check smitty กับ /etc/hosts ว่าตรงกันเปล่า
เย้ๆ ใช้ได้แร้วว
10月2日

Create Oracle db. manual

สรุป
1. สร้าง user สำหรับ oracle โดยต้องมี group เป็น dba ทั้ง 3 group เซ็ต hard กับ soft เป็น -1 ให้หมด ถึง 022 อย่าลืมเซ็ตเป็น csh เพราะใช้ korn shell ไม่เป็น
    smitty user
    เปลี่ยน password ด้วยเด้ะ
    passwd
2. เซ็ต environment ex. .cshrc พวก sid
--------------------ตัวอย่าง environment Surprised---------------------
setenv SDEHOME /software/sde91/sdeexe91
setenv ORACLE_HOME /software/oracle
setenv ORACLE_SID mea3fd
setenv TNS_ADMIN $ORACLE_HOME/network/admin
setenv LIBPATH $SDEHOME/lib:/usr/lib:/usr/dt/lib:/usr/ucblib:$ORACLE_HOME/lib
setenv ORACLE_TERM xsun5
setenv NLS_LANG thai_thailand.th8tisascii
setenv ORA_NLS $ORACLE_HOME/ocommon/nls/admin/data
setenv PATH $SDEHOME/bin:$ORACLE_HOME/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/bin:/usr/ucb:/usr/sbin:/usr/5bin:/etc:/usr/bin/X11:/sbin
---------------------**************-----------------------
3. สร้าง initdb_name.ora ที่ path $ORACLE_HOME/dbs
-----------------------ตัวอย่าง init.ora Tongue out-------------------------
testRep.__java_pool_size=10240
testRep.__large_pool_size=0
testRep.__java_pool_size=10240
testRep.__large_pool_size=0
testRep.__streams_pool_size=0
*.shared_pool_size=629145600
#*.db_cache_size=943718400
*.audit_file_dest='/software/oracle/admin/testRep/adump'
*.background_dump_dest='/software/oracle/admin/testRep/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/data1/oradata/testRep/control01.ctl','/data1/oradata/testRep/control02.ctl','/data1/oradata/testRep/control03.ctl'
*.core_dump_dest='/software/oracle/admin/testRep/cdump'
testRep.__java_pool_size=10240
testRep.__large_pool_size=0
testRep.__streams_pool_size=0
*.shared_pool_size=629145600
#*.db_cache_size=943718400
*.audit_file_dest='/software/oracle/admin/testRep/adump'
*.background_dump_dest='/software/oracle/admin/testRep/bdump'
*.Compatible='10.2.0.3.0'
*.control_files='/data1/oradata/testRep/control01.ctl','/data1/oradata/testRep/control02.ctl','/data1/oradata/testRep/control03.ctl'
*.core_dump_dest='/software/oracle/admin/testRep/cdump'
*.db_block_buffers=96000
*.db_block_size=16384
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='testRep'
*.db_recovery_file_dest='/software/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testRepXDB)'
*.job_queue_processes=10
*.nls_language='THAI'
*.open_cursors=5000
*.pga_aggregate_target=31457280
*.processes=100
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=115
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/software/oracle/admin/testRep/udump'
--------------------**************-----------------------
3. create folder สำหรับสร้าง audit file
-------------------- Left hugสร้าง folder for audit Right hug-----------------------
    cd $ORACLE_HOME
    mkdir admin
    cd admin
    mkdir adump
    mkdir bdump
    mkdir udump
--------------------**************-----------------------
4. create database ได้เล้ย
    sqlplus '/as sysdba'
    startup nomount pfile='';
    create database อิงจากหัวข้อ create controlfile ได้เลย้ แต่มีตย.ให้ดูไว้นิดนึงส อิอิ
-----------------------ตัวอย่าง create controlfile Red lips-------------------------
create database testRep
  logfile   group 1 ('/data2/oradata/testRep/redo01.log') size 50M,
            group 2 ('/data2/oradata/testRep/redo02.log') size 50M,
            group 3 ('/data2/oradata/testRep/redo03.log') size 50M
  character set TH8TISASCII
  national character set utf8
  datafile '/data1/oradata/testRep/system01.dbf'
            size 250M
            autoextend on
            next 10M maxsize unlimited
            extent management local
  sysaux datafile '/data1/oradata/testRep/sysaux01.dbf'
            size 250M
            autoextend on
            next 10M
            maxsize unlimited
  undo tablespace UNDOTBS1
<- เซ็ตชื่อ undotbs ให้ถูกตามที่ set ไว้ใน initfile มิเช่นนั้นจะขึ้น ตามด้านล่างนู่น
            datafile '/data2/oradata/testRep/undotbs01.dbf'
            size 1000M
            autoextend on
            next 10M
            maxsize unlimited
  default temporary tablespace temp
            tempfile '/data2/oradata/testRep/TEMPS.dbf'
            size 1500M;
--------------------**************-----------------------
5. ถ้าขึ้น error แบบด้านล่างนี่กลับไปเช็ค parameter นะ
create database testRep
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
6. หลังจาก create ได้แร้ว ให้รัน
SQL> @?/rdbms/admin/catalog.sql <- create data dictionary
SQL> @?/rdbms/admin/catproc.sql <- create all structures require for PL/SQL
7. ถ้าต้องการ creates a table that allows to block someone from using sql plus
SQL> connect system/manager
SQL> @?/sqlplus/admin/pupbld
 
8. เปลี่ยน pass ด้วยจ้า

alter user sys identified by whatever;

alter user system identified by whatever;

reference :
http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html
ไว้สำหรับ create db. บน winNT
ดีๆอีกหนึ่งที่
--------------------เย้ๆ เส็ดแร้นๆ Red lips-----------------------
10月1日

Copy db. ข้าม maintainace level

Chapter 1. Database Cloning -- Manual

Follow the steps below to clone the database in manual mode:-

  • alter database backup controlfile to trace;.

  • Shutdown the old instance

  • Take a cold backup of the control files, datafiles, redo logs - if you want but not really required, initSID.ora file.

  • Copy (via tape, ftp etc) the dump files, control files, redo, initSID.ora and the control file trace over to the new environment.

  • Edit the control file trace to : * Remove all the comments from the top and bottom of the script. * Remove the startup nomount and recover database commands from the script. * Change create controlfile reuse database "old_name" noresetlogs ... to create controlfile reuse set database "new_name" resetlogs .... * Change the paths and file names for the datafiles and logfiles to match the new locations. * Save the file with a meaningful name - controlfile.sql for example.

  • Edit the initSID.ora file to : * Change the db_name parameter to match the new name given in the controlfile.sql script created above. * Change the paths to the control file(s). * Change the paths to user_dump_dest, background_dump_dest and core_dump_dest locations as appropriate, also log_archive_dest if the database is in archive log mode.

  • Alter database open resetlogs; will then open the database. If you didn't copy the redo files over, or if you changed their names in the control file script, then new files will be created for you.

Chapter 2. Database Cloning -- Practice


How to clone a database?

Let us assume that our source database is :- 
SOURCE Database:MYLCL
and that the target database is:-
TARGET DATABASE:LCLYM ( Reverse of MYLCL )

Let us further assume that the database is running in NOARCHIVELOG mode.
Depending on this distribution you will find below the steps to clone
a database in Unix and Windows World.

DB : NOARCHIVELOG
  UNIX
  Steps to be performed on the SOURCE
  Note down the parameters for the location 
  as below 
  show parameter dump;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_core_dump                 string      partial

background_dump_dest                 string      /u02/app/oracle/admin/MYLCL/bd
                                                 ump

core_dump_dest                       string      /u02/app/oracle/admin/MYLCL/cd
                                                 ump
max_dump_file_size                   string      UNLIMITED
shadow_core_dump                     string      partial
user_dump_dest                       string      /u02/app/oracle/admin/MYLCL/ud
                                                 ump

Retrieve the informatino about location of datafiles:-

   SELECT SUBSTR( name, 1, INSTR(name,'/', -1 ) ) FROM v$datafile_header WHERE
   ROWNUM < 2

   SUBSTR(NAME,1,INSTR(NAME,'/',-1))
   --------------------------------------------------------------------------------
   /u02/oradata/MYLCL/

Generate text version of create controlfile script:
  Issue the following commands to generate a text contorl file create script:-

  ALTER SYSTEM SWITCH LOGFILE;
  ALTER SYSTEM SWITCH LOGFILE;
  ALTER SYSTEM CHECKPOINT;

  ALTER DATABASE BACKUP CONTROLFILE TO TRACE ;
  TO get a ascii trace dump of the database.

  The location of the trace file will be in udump/ directory
  SQL> show parameter dump

  NAME                                 TYPE        VALUE
  ------------------------------------ ----------- ------------------------------
  background_dump_dest                 string      /u01/app/oracle/admin/MYLCL/bdump
  user_dump_dest                       string      /u01/app/oracle/admin/MYLCL/udump
 
  TARGET
  _______
  Steps to be performed on the TARGET
  ora> cd $ORACLE_HOME/dbs
  cp $ORACLE_HOME/dbs/src/<SID>ora trg<SID>ora
  Customize the dump directory and control file location
  


  *.background_dump_dest='/u01/app/oracle/admin/LCLYM/bdump'
  *.backup_tape_io_slaves=TRUE
  *.compatible='9.2.0.0.0'
  *.control_files='/u01/control/LCLYM/control01.ctl','/u02/control/LCLYM/control02.ctl','/u03/control/LCLYM/control03.ctl'
  *.core_dump_dest='/u01/app/oracle/admin/LCLYM/cdump'
  

    
  Ensure that the directories for the dump and the controlfile and the datafile are in place.
  Once everything looks good shutdown the source database and cold copy the datafiles and the control
  files into the new location.

  SOURCE:
  

  SQl>sqlplus / as syssdba
  SQl>shutdown immediate;

  ora> cp -r MYLCL LCLYM # Copy the files to the target location 
  
  SQl>sqlplus / as sysdba
  SQl>startup;
  Start the source so that users can connect to the source database and resume their work.
  


  TARGET:
  

  Issue the create controlfile command from the generated source of the create controlfile command.
  *SET* change REUSE to SET.

CREATE CONTROLFILE *SET* DATABASE "LCLYM" RESETLOGS  ARCHIVELOG
--  SET STANDBY TO MAXIMIZE PERFORMANCE
    MAXLOGFILES 16
    MAXLOGMEMBERS 2
    MAXDATAFILES 30
    MAXINSTANCES 1
    MAXLOGHISTORY 453
LOGFILE
  GROUP 1 '/u02/oradata/LCLYM/redo1.log'  SIZE 10M,
  GROUP 2 '/u02/oradata/LCLYM/redo2.log'  SIZE 10M,
  GROUP 3 '/u02/oradata/LCLYM/redo3.log'  SIZE 10M
-- STANDBY LOGFILE
DATAFILE
  '/u02/oradata/LCLYM/system.dbf',
  '/u02/oradata/LCLYM/UNDOTBS1.dbf',
  '/u02/oradata/LCLYM/system2.dbf',
  '/u02/oradata/LCLYM/drp_me5.dbf',
  '/u02/oradata/LCLYM/tbls_me.dbf',
  '/u02/oradata/LCLYM/tbls_data.dbf',
  '/u02/oradata/LCLYM/undotbs02.dbf'
CHARACTER SET WE8ISO8859P1
  

;

Once the control file has been created we have to use the
alter database open resetlogs to open the database.

ALTER DATABASE OPEN RESETLOGS;

Create the temp tablespace afterwards.


CREATE TEMPORARY TABLESPACE TEMP datafile '/u02/oradata/MYLCL/temp_01.dbf' size 10M;
ALTER DATABASE DEFAULT temporary tablespace TEMP;

  Check SELECT * FROM v$recover_file ; to ensure that they are no files that require recovery.

If you get error disconnection enforced, look at the alert<SID>log to see what is causing the
probelm. usually it is either the undo tablespace or dump directory location. Once you set
this reattempt to create the control file.
  
  WINDOWS
  Please follow the steps above for creating the spfile.
  Once you have the spfile ready, please create the service for the oracle database:-

  oradim -new oracleserviceLCLYM -syspwd oracle -startupmode manual -pfile
  'c:\oracle\product\db_1\database\init<SID>ora'
  This will create a new service.
  In order to start the service 
  net start oracleserviceLCLYM
  if the service is already running then a message will be displayed by the windows machine that the service is already running.
 
  To Delete a service use 
  oradim -delete oracleserviceLCLYM

  Here is the help for oracle service creation through oradim

C:\>oradim
ORADIM: <command> [options].  Refer to manual.
Enter one of the following command:
Create an instance by specifying the following options:
     -NEW -SID sid | -SRVC srvc | -ASMSID sid | -ASMSRVC srvc [-SYSPWD pass]
 [-STARTMODE auto|manual] [-SRVCSTART system|demand] [-PFILE file | -SPFILE]
 [-SHUTMODE normal|immediate|abort] [-TIMEOUT secs] [-RUNAS osusr/ospass]
Edit an instance by specifying the following options:
     -EDIT -SID sid | -ASMSID sid [-SYSPWD pass]
 [-STARTMODE auto|manual] [-SRVCSTART system|demand] [-PFILE file | -SPFILE]
 [-SHUTMODE normal|immediate|abort] [-SHUTTYPE srvc|inst] [-RUNAS osusr/ospass]
Delete instances by specifying the following options:
     -DELETE -SID sid | -ASMSID sid | -SRVC srvc | -ASMSRVC srvc
Startup services and instance by specifying the following options:
     -STARTUP -SID sid | -ASMSID sid [-SYSPWD pass]
 [-STARTTYPE srvc|inst|srvc,inst] [-PFILE filename | -SPFILE]
Shutdown service and instance by specifying the following options:
     -SHUTDOWN -SID sid | -ASMSID sid [-SYSPWD pass]
 [-SHUTTYPE srvc|inst|srvc,inst] [-SHUTMODE normal|immediate|abort]
 Query for help by specifying the following parameters: -? | -h | -help

  After the service is up and running, please follow the steps
  above for clonging a database from step 2 onwards.


ARCHIVE LOG
  UNIX
  Steps to be performed on the SOURCE
  Identify the user dump destination and the datafile location and modify the
  init<SID>ora accordingly.
  Copy the files from the source data directory location to the destination data directory location.
  We will not need to shutdown the database since this will be a hot clone, the source database will be 
  up and running while we perform the cloning process.

  
  ora> cp -r MYLCL LCLYM # Copy the files to the target location 
  Once all the datafiles have been copied over, please ensure that the admin directories have been created.
  
  export ORACLE_SID=LCLYM
  sqlplus /nolog
  connect / as sysdba
  startup nomount;

CREATE CONTROLFILE SET DATABASE "LCLYM" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 2
    MAXDATAFILES 30
    MAXINSTANCES 1
    MAXLOGHISTORY 453
LOGFILE
  GROUP 1 '/u02/oradata/LCLYM/redo1.log'  SIZE 10M,
  GROUP 2 '/u02/oradata/LCLYM/redo2.log'  SIZE 10M,
  GROUP 3 '/u02/oradata/LCLYM/redo3.log'  SIZE 10M
DATAFILE
  '/u02/oradata/LCLYM/system.dbf',
  '/u02/oradata/LCLYM/UNDOTBS1.dbf',
  '/u02/oradata/LCLYM/system2.dbf',
  '/u02/oradata/LCLYM/drp_me5.dbf',
  '/u02/oradata/LCLYM/tbls_me.dbf',
  '/u02/oradata/LCLYM/tbls_data.dbf',
  '/u02/oradata/LCLYM/undotbs02.dbf'
CHARACTER SET WE8ISO8859P1
;

If you get the error
CREATE CONTROLFILE SET DATABASE "LCLYM" RESETLOGS  ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: controlfile could not be created
ORA-00202: controlfile: '/u01/control/LCLYM/control01.ctl'
ORA-27038: skgfrcre: file exists

It means that the control file already exists just remove the control file and try again.

--> /u01/app/oracle/product/9.2.0/dbs
ora> rm -i /u01/control/LCLYM/control01.ctl /u02/control/LCLYM/control02.ctl /u03/control/LCLYM/control03.ctl
rm: remove /u01/control/LCLYM/control01.ctl? y
rm: remove /u02/control/LCLYM/control02.ctl? y
rm: remove /u03/control/LCLYM/control03.ctl? y
--> /u01/app/oracle/product/9.2.0/dbs


Trying once again you should get the message
Control file created.

Since the database will be in mounted state once the control file has been created.
Just open the database.
 
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u02/oradata/LCLYM/system.dbf'

You can either recover individual datafiles or recover the entire database.

SQL> recover database using backup controlfile;
ORA-00279: change 1033682 generated at 07/18/2006 14:48:38 needed for thread 1
ORA-00289: suggestion : /u03/archive/LCLYM/arch_1_3.dbf
ORA-00280: change 1033682 for thread 1 is in sequence #3


Specify log: {<RET>suggested | filename | AUTO | CANCEL}

CANCEL

Try opening again , you may still get the same error
at this point feed the redo logs that you copied for the database.

Try each of the 3 redo logs
SQL> recover database using backup controlfile;
ORA-00279: change 1033682 generated at 07/18/2006 14:48:38 needed for thread 1
ORA-00289: suggestion : /u03/archive/LCLYM/arch_1_3.dbf
ORA-00280: change 1033682 for thread 1 is in sequence #3


Specify log: {<RET>suggested | filename | AUTO | CANCEL}
/u02/oradata/LCLYM/redo1.log
ORA-00310: archived log contains sequence 1; sequence 3 required
ORA-00334: archived log: '/u02/oradata/LCLYM/redo1.log'

You should get the messsage log applied, media recovery complete as in :-

SQL> recover database using backup controlfile;
ORA-00279: change 1033682 generated at 07/18/2006 14:48:38 needed for thread 1
ORA-00289: suggestion : /u03/archive/LCLYM/arch_1_3.dbf
ORA-00280: change 1033682 for thread 1 is in sequence #3


Specify log: {<RET>suggested | filename | AUTO | CANCEL}
/u02/oradata/LCLYM/redo3.log
Log applied.
Media recovery complete.


SQL> alter database open resetlogs ;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced

Now 01092 means you have to look at the alert.log to figure out what is going wrong.

Errors in file /u01/app/oracle/admin/LCLYM/udump/abdaq_ora_288014.trc:
ORA-30012: undo tablespace 'UNDOTBS2' does not exist or of wrong type
Tue Jul 18 16:24:09 2006

Modify the init<SID>ora to undotbs02 and try again, it was just
misspelt in the init<SID>ora file.

Since database was closed abnormally it would require media
recovery when you startup.
Connected to an idle instance.

SQL> startup ;
ORACLE instance started.

Total System Global Area  856954312 bytes
Fixed Size                   734664 bytes
Variable Size             318767104 bytes
Database Buffers          536870912 bytes
Redo Buffers                 581632 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u02/oradata/LCLYM/system.dbf'


SQL> select * from v$Instance;

INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
HOST_NAME
----------------------------------------------------------------
VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_
----------------- --------- ------------ --- ---------- ------- -----------
LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST
---------- --- ----------------- ------------------ ---------
              1 LCLYM
mylcldb.home.net
9.2.0.4.0         18-JUL-06 MOUNTED      NO           1 STARTED
ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL


SQL> recover database;
Media recovery complete.

SQL> alter database open;

Database altered.

CREATE TEMPORARY TABLESPACE TEMP tempfile '/u02/oradata/LCLYM/temp_01.dbf' size 10M

Add the temporary tablespace to the database.

SQL> select * from v$recover_file;

no rows selected

Backup the database, your database has been cloned successsfully.

WINDOWS
The steps will be similar in windows and unix except that you have to 
add a new oracle service for your process, by using the oradim command.

Rest of the steps are all the same in both environments.

Chapter 3. Database Cloning -- RMAN

--ยังหาข้อมูลไม่ได้อ่า--

 

สรุป

Source Machine
1. alter database backup controlfile to trace as '.....'; 
2. shutdown normal
3. copy datafile ไม่เอา temp, control file, undo,redo , folder admin, init[db_name].ora ใน dbs
 
Destination Machine
1. sqlplus '/as sysdba' ถ้าไม่ติด ให้แก้ initfile.ora
2. startup nomount pfile='............'
3. เอา controlfile ที่ backup มาแก้ path แร้วรัน -> ถ้า run ไม่ผ่านให้เช็ค file ว่าเอามาถูกตัวมั้ย เทียบกับ db.ตัวเก่า select * from V$DATAFILE ;
4. แล้ว ALTER DATABASE OPEN RESETLOGS;
5. จะมี error อยู่ 2 แบบถ้าขึ้น error ว่า
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced

 --------------------- ถ้าขึ้น error แบบนี้ให้ไปทำที่ข้อ 8------------------------
 
ถ้าขึ้น error ว่า
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u02/oradata/LCLYM/system.dbf'

 ปามานนี้ ให้
SQL> recover database using backup controlfile;
ORA-00279: change 1033682 generated at 07/18/2006 14:48:38 needed for thread 1
ORA-00289: suggestion : /u03/archive/LCLYM/arch_1_3.dbf
ORA-00280: change 1033682 for thread 1 is in sequence #3


Specify log: {<RET>suggested | filename | AUTO | CANCEL}


CANCEL
4. แล้ว ALTER DATABASE OPEN RESETLOGS; อีกทีนึง
5. ถ้าขึ้น error อยู่เหมือนเดิม อย่าเพิ่งเซ็ง ให้ลองเปลี่ยนเป็นใส่ redolog 

Try each of the 3 redo logs
SQL>
 recover database using backup controlfile;
ORA-00279: change 1033682 generated at 07/18/2006 14:48:38 needed for thread 1
ORA-00289: suggestion : /u03/archive/LCLYM/arch_1_3.dbf
ORA-00280: change 1033682 for thread 1 is in sequence #3


Specify log: {<RET>suggested | filename | AUTO | CANCEL}
/u02/oradata/LCLYM/redo1.log
ORA-00310: archived log contains sequence 1; sequence 3 required
ORA-00334: archived log: '/u02/oradata/LCLYM/redo1.log'

You should get the messsage log applied, media recovery complete as in :-

SQL>
 recover database using backup controlfile;
ORA-00279: change 1033682 generated at 07/18/2006 14:48:38 needed for thread 1
ORA-00289: suggestion : /u03/archive/LCLYM/arch_1_3.dbf
ORA-00280: change 1033682 for thread 1 is in sequence #3


Specify log: {<RET>suggested | filename | AUTO | CANCEL}
/u02/oradata/LCLYM/redo3.log
Log applied.
Media recovery complete. <---- โอ้แม่เจ้า ได้แร้ว
 
6. ถ้าไม่ได้แปลว่าเอามาผิดตัวให้ไปเอามาใหม่
7. ลองอีกครั้ง
SQL> alter database open resetlogs ;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
8. ถ้า error เป็นแบบนี้ให้ check ใน log ที่ $oracle_home/admin/ชื่อdb/udump/ไฟล์ล่าสุด.trc
9. ถ้า error
ORA-00704: 引导程序进程失败
ORA-39700: 必须用 UPGRADE 选项打开数据库
ให้
 
SHUTDOWN IMMEDIATE
STARTUP UPGRADE PFILE='/opt/oracle/product/10.2.0/dbs/init_00il1i4r_1_0.ora'
@@ ?/rdbms/admin/utlirp.sql
SHUTDOWN IMMEDIATE
STARTUP PFILE='/opt/oracle/product/10.2.0/dbs/init_00il1i4r_1_0.ora'
-- The following step will recompile all PL/SQL modules.
-- It may take serveral hours to complete.
@@ ?/rdbms/admin/utlrp.sql
set feedback 6;


โดยสามารถดูได้จากด้านล่าง

SQL>
startup upgrade; <- มันช่วยได้เจงๆ
ORACLE 例程已经启动。

Total System Global Area 943718400 bytes
Fixed Size 1293960 bytes
Variable Size 239075704 bytes
Database Buffers 700448768 bytes
Redo Buffers 2899968 bytes
数据库装载完毕。
ORA-01113: 文件 1 需要介质恢复
ORA-01110: 数据文件 1:'C:ORACLEORADATAJULIADATAFILEO1_MF_SYSTEM_37TC1XNS_.DBF'
SQL> recover database; <--สำคัญนะ
完成介质恢复。
恢复完成之后启动数据库到UPGRADE模式:
SQL> shutdown immediate;
ORA-01109: 数据库未打开

已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup upgrade;
ORACLE 例程已经启动。

Total System Global Area 943718400 bytes
Fixed Size 1293960 bytes
Variable Size 239075704 bytes
Database Buffers 700448768 bytes
Redo Buffers 2899968 bytes
数据库装载完毕。
数据库已经打开。
 
------------------ ได้แร้นนนนนนนน Open-mouthed แต่ยังไม่สามารถ start ปกติได้ต้อง run utlirp.sql เพิ่ม--------------------------

DOC>#######################################################################
DOC> utlirp.sql completed successfully. All PL/SQL objects in the
DOC> database have been invalidated.
DOC>
DOC> Shut down and restart the database in normal mode and run utlrp.sql to
DOC> recompile invalid objects.
DOC>#######################################################################

也就是说,这个脚本的作用是使数据库中的PL/SQL对象INVALID,然后通过utlrp.sql的重新编译,消除跨平台的兼容性影响。
按照transport.sql脚本提示的步骤,我们可以重新启动数据库来执行utlrp.sql脚本(由于本例涉及到版本迁移,需要再次启动数据库到upgrade模式,如果数据库版本相同,则可以直接启动数据库,执行utlrp.sql脚本完成最后的编译工作):


SQL> @@ ?/rdbms/admin/utlrp.sql
TIMESTAMP
-------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2007-06-25 10:27:57
............
PL/SQL 过程已成功完成。
TIMESTAMP
-------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2007-06-25 10:39:43
PL/SQL 过程已成功完成。

utlrp.sql执行完成之后我们需要再执行和数据库升级相关的脚本,这个脚本是catupgrd.sql:

SQL> @?/rdbms/admin/catupgrd.sql

这个脚本调用catlog.sql和 catproc.sql来重建字典对象等,在执行完这个脚本之后,我们可以关闭数据库后,正常打开数据库:


SQL> startup
ORACLE 例程已经启动。

Total System Global Area 943718400 bytes
Fixed Size 1293960 bytes
Variable Size 239075704 bytes
Database Buffers 700448768 bytes
Redo Buffers 2899968 bytes
数据库装载完毕。
数据库已经打开。
 
----------------------------- ขึ้นจริงๆแร้วจ้า Tongue out-------------------------------

SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
86
已选择 1 行。
SQL> @?rdbmsadminutlrp.sql


catupgrd.sql脚本可能会使部分字典对象失效,我们可以再次运行utlrp.sql脚本来进行编译,编译完成后,不要忘记为数据库添加临时文件:


SQL> ALTER TABLESPACE TEMP ADD TEMPFILE
2 SIZE 20971520 AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
9月30日

แก้ error windows xp sp3 ลงไทยไม่ได้

วิธีแก้ที่ window set regional เป็นไทย แร้วมัน error คือ
 
1. copy file intl.inf จาก folder i386 ของแผ่น window ที่ใช้ภาษาไทยได้
2. paste file นั้นลงไปใน C:\WINDOWS\inf ทับไฟล์เดิมที่มีอยู่
 
อะฮ้า!!!! ได้แว้วววววววววววววววววววววววววววววววววว Wink
9月28日

example of create control file

sqlplus '/as sysdba'
startup nomount pfile='..../init[db_name].ora'
CREATE CONTROLFILE REUSE DATABASE "mea3fd" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/data2/oradata/mea3fd/redo01.log'  SIZE 50M,
  GROUP 2 '/data2/oradata/mea3fd/redo02.log'  SIZE 50M,
  GROUP 3 '/data2/oradata/mea3fd/redo03.log'  SIZE 50M
DATAFILE
  '/data1/oradata/mea3fd/system01.dbf',
  '/data2/oradata/mea3fd/undotbs01.dbf',
  '/data2/oradata/mea3fd/undotbs02.dbf',
  '/data1/oradata/mea3fd/sysaux01.dbf',
  '/data1/oradata/mea3fd/users01.dbf',
  '/data1/oradata/mea3fd/sde01.dbf',
  '/data1/oradata/mea3fd/meadata01.dbf',
  '/data1/oradata/mea3fd/meadata02.dbf',
  '/data1/oradata/mea3fd/meadata03.dbf',
  '/data1/oradata/mea3fd/meadata04.dbf',
  '/data1/oradata/mea3fd/meadata05.dbf',
  '/data1/oradata/mea3fd/tordata01.dbf',
  '/data1/oradata/mea3fd/process_data01.dbf'
CHARACTER SET TH8TISASCII;
-> นี่มานชุดเดียวกันเน้อ
 
ALTER DATABASE OPEN RESETLOGS;

ALTER TABLESPACE TEMPS ADD TEMPFILE '/data2/ora_data/mea3fd/TEMPS.dbf';
 
-------------------------------------*********************-------------------------------------
หรือไม่ก้อสามารถไปหาได้จาก
alter database backup controlfile to trace;
alter database backup controlfile to trace as '/some/arbitrary/path';
สงสัยว่า
ALTER DATABASE BACKUP CONTROLFILE TO TRACE NORESETLOGS;  มันต่างกันไงอะ
แหงกๆDisappointed
 

คำสั่งบน AIX

#smitty top

#smitty hacmp

#smityy update_all

#smitty system

#smitty aic

#smitty disk

#smitty tcpip

#smitty fs

#smitty vg

#smitty lv -> ไว้แก้พวก logical น้า

#smitty user

#smitty varyoff

#smitty group

#smitty chfs -> อันนี้ love มั่กๆ ไว้แก้ตอน mount point ขนาดไม่พอน้า อิอิ

เจอ error ตอน ALTER DATABASE OPEN RESETLOGS;

ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/data1/oradata/mea3fd/system01.dbf'
Disappointed
---------------------*****************-----------------------------------
alter database backup controlfile to '/folder_bak/contrl_bak.ctl';
shutdown immediate;
startup nomount;
recover database using backup controlfile;
shutdown database mount;
startup;
 
---------------------*****************------------------------------------
งมตั้งนานแน่ะ เย้ๆ
Open-mouthed