Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3326988
  • 博文数量: 631
  • 博客积分: 10716
  • 博客等级: 上将
  • 技术积分: 8397
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 22:35
文章分类

全部博文(631)

文章存档

2020年(2)

2019年(22)

2018年(4)

2017年(37)

2016年(22)

2015年(1)

2013年(12)

2012年(20)

2011年(19)

2010年(20)

2009年(282)

2008年(190)

分类: Oracle

2010-01-22 22:30:22

~]# su - oracle
[oracle@RAC2 ~]$ sqlplus / as sysdba<> startup
> !
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 22 12:09:49 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              62916852 bytes
Database Buffers          100663296 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@RAC2 ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-JAN-2010 12:10:14
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Starting /opt/oracle10g/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Log messages written to /opt/oracle10g/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RAC2)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                22-JAN-2010 12:10:14
Uptime                    0 days 0 hr. 0 min. 2 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /opt/oracle10g/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RAC2)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@RAC2 admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle10g/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )
racdb1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = racdb1)
    )
  )
racdb2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.101)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = racdb2)
    )
  )
[oracle@RAC2 admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 22 12:17:30 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> aechive log list;
SP2-0734: unknown command beginning "aechive lo..." - rest of line ignored.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/ora10g/arch/
Oldest online log sequence     0
Next log sequence to archive   0
Current log sequence           81
SQL> create pfile='/tmp/initracdb2.ora' from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@RAC2 admin]$ ll /tmp/initracdb2.ora
-rw-r--r--  1 oracle oinstall 1323 Jan 22 12:18 /tmp/initracdb2.ora
[oracle@RAC2 admin]$ more /tmp/initracdb2.ora
racdb2.__db_cache_size=100663296
racdb2.__java_pool_size=4194304
racdb2.__large_pool_size=4194304
racdb2.__shared_pool_size=54525952
racdb2.__streams_pool_size=0
*.background_dump_dest='/opt/oracle10g/admin/racdb2/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/opt/oracle/stage/std.ctl'
*.core_dump_dest='/opt/oracle10g/admin/racdb2/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='+DATA/racdb1/','/opt/oracle/oradata/'
*.db_name='racdb1'
*.db_unique_name='racdb2'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=DGDBXDB)'
*.FAL_CLIENT='racdb1'
*.FAL_SERVER='racdb2'
*.job_queue_processes=10
*.log_archive_config='dg_config=(racdb1,racdb2)'
*.log_archive_dest_1='LOCATION=/opt/ora10g/arch/ VALID_FOR=(all_logfiles,all_roles) db_unique_name=racdb2'
*.log_archive_dest_2='service=racdb1 valid_for=(online_logfiles,primary_role) db_unique_name=racdb1'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
*.log_file_name_convert='+DATA/racdb1/onlinelog/','/opt/oracle/oradata/'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='exclusive'
*.sga_target=167772160
*.standby_file_management='auto'
*.thread=1
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/opt/oracle10g/admin/racdb2/udump'
测试
[oracle@RAC1 admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 22 12:43:01 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from data;
        ID
----------
         2
         2
SQL> insert into data values(3);
1 row created.
SQL> commit;
Commit complete.
SQL> alter system archive log current;
System altered.
SQL>  alter system archive log current;
System altered.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/ora10g/arch/
Oldest online log sequence     81
Next log sequence to archive   83
Current log sequence           83
SQL> select * from data;
        ID
----------
         2
         2
         3
SQL>
[oracle@RAC2 admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 22 12:20:12 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from data;
        ID
----------
         2
         2
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/ora10g/arch/
Oldest online log sequence     0
Next log sequence to archive   0
Current log sequence           83
SQL>  select * from data;
        ID
----------
         2
         2
SQL>  select * from data;
        ID
----------
         2
         2
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> recover managed standby database cancel;
Media recovery complete.
SQL> alter database open read only;
Database altered.
SQL>  select * from data;
        ID
----------
         2
         2
         3
SQL>
阅读(2735) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~