Wednesday, July 6, 2011

NIS on Solaris 10

Setting up a simple NIS evironment in Solaris 10

1 Introduction

1.1 Purpose
This document describes how to setup a Network Information System (aka NIS) enviroment with one master server and one client.

1.2 Preparation
TCP/IP should be running on all systems that should be part of the NIS environment. All clients should be mentioned in the /etc/hosts file of nfs server server_nis.
I am using NFS and Automount in this document.


2 List all NIS services


# svcs "*nis*"
STATE STIME FMRI
disabled 13:09:23 svc:/network/rpc/nisplus:default
disabled 13:09:39 svc:/network/nis/update:default
disabled 13:09:39 svc:/network/nis/server:default
disabled 13:09:39 svc:/network/nis/xfr:default
disabled 13:09:40 svc:/network/nis/passwd:default
disabled 13:09:43 svc:/network/nis/client:default


3 Setting up NFS server server_nis


A NIS server does not need a NFS server to operate correctly. But NIS is mostly used to accomodate roaming user in a Unix environment. In this environment NIS is used to make the user databases available on the network. NFS is the used to make the home directories available.

3.1 Setting up NFS

# vi /etc/dfs/dfstab
+-------------------
| share -F nfs /export/home

# svcadm enable nfs/server

# shareall

3.2 Configure automount

# vi /etc/auto_home
+------------------
| * server_nis:/export/home/&


4 Create an extra user


# useradd -d /export/home/user1 -m -s /usr/bin/bash user1
# usermod -d /home/user1 user1

5 Setting up NIS server server_nis

5.1 Create the files needed with NIS

# cp /etc/nsswitch.nis /etc/nsswitch.conf

# domainname nis.world
# domainname > /etc/defaultdomain

# cd /etc
# touch ethers bootparams locale timezone netgroup netmasks

5.2 Make server_nis a Master server

# ypinit -m
-- Output skipped --
next host to add: server_nis
next host to add:
The current list of yp servers looks like this:

server_nis

Is this correct? [y/n: y] y

-- Output skipped --

Do you want this procedure to quit on non-fatal errors? [y/n: n] n

5.3 Check the NIS daemons status
# svcs nis/server

5.4 Create the NIS maps
# cd /var/yp
# /usr/ccs/bin/make

5.5 Test the master NIS server server_nis
# ypwhich
# ypwhich -m
# ypcat hosts
# ypmatch server_nis hosts
# ypmatch user1 passwd

6 Configure NIS client client_nis

6.1 Configure automount
# vi /etc/auto_home
+------------------
| * server_nis:/export/home/&

6.2 Create the files needed with NIS
# cp /etc/nsswitch.nis /etc/nsswitch.conf

# domainname nis.world

# domainname > /etc/defaultdomain

6.3 Make client_nis a NIS client

# ypinit -c
-- Output skipped --
next host to add: server_nis
next host to add:

6.4 Start the NIS daemons
# svcadm enable nis/client

6.5 Reboot the system
# init 6

6.6 Testing the NIS client (client_nis)
# ypwhich
# ypwhich -m
# ypcat hosts
# ypmatch user1 passwd


7 Adding an extra user to NIS


7.1 Adding the user on the master server (server_nis)
# useradd -d /export/home/user2 -m -s /usr/bin/bash user2
# usermod -d /home/user2 user2

# passwd user2

7.2 Updating the NIS maps on the master server (server_nis)
# cd /var/yp
# /usr/ccs/bin/make

7.3 Using new user to log in
Go to NIS client client_nis and try to log in as user2.

8 Set up NIS slave server slave_nis


8.1 Create the files needed with NIS
# cp /etc/nsswitch.nis /etc/nsswitch.conf

# domainname nis.world
# domainname > /etc/defaultdomain


8.2 Make iene a NIS client
# ypinit -c

-- Output skipped --
next host to add: server_nis
next host to add: slave_nis
next host to add:
* Make sure that the ypserv process is running on the NIS master server *
# svcadm enable nis/client

8.3 Make slave_nis a slave server
# ypinit -s server_nis
-- Output skipped --
Do you want this procedure to quit on non-fatal errors? [y/n: n] n
# svcadm disable nis/client
# svcadm enable nis/server

9 Securing NIS

9.1 /etc/securenets
In the default installation of NIS, any host that can reach the NIS master server or Slave server can connect as a client and look at the contents of the NIS map files. To overcome this problem you can use the /etc/securenets file.

9.1.1 Create securenets
# vi /etc/securenets
o-------------------
| # Grant access to a specific host
| hosts 172.16.60.x
|
| # Grant access to all hosts on a subnet
| 255.255.255.0 172.16.60.0

9.2 passwd.adjunct
Another problem with the default setup of NIS is that all users can retrieve the compiled password of any user account in the NIS passwd map. This is because NIS joins the /etc/passwd and /etc/shadow file into one passwd map.
User can read the passwd map by running the ypcat passwd command.
$ ypcat passwd | grep abhi
abhi:QWasxs.poskw4:1000:1:MeMyselfI:/home/abhi:/bin/bash
The passwd.adjunct file can be used to remove the encrypted password from the ypcat command output.

9.3 Creating passwd.adjunct
# mkdir /var/yp/security

# chown root security
# chmod 700 security
# nawk -F\: '{printf("%s:%s:::::\n",$1,$2)}'
/etc/passwd > /etc/security/passwd.adjunct

9.3.1 Fixing the passwd file
# cp /etc/passwd /etc/passwd.original
# nawk -F\:
'{printf("%s:##%s:%s:%s:%s:%s:%s\n",$1,$1,$3,$4,$5,$6,$7)}'
/etc/passwd > /etc/passwd.new

# cat /etc/passwd.new
Check if the passwd.new file is correct.
# cp -i /etc/passwd.new /etc/passwd cp: overwrite /etc/passwd (yes/no)? yes

9.3.2 Generate new map files
# cd /var/yp
# /usr/ccs/bin/make

9.3.3 Test Configuration

# ypmatch abhi passwd
abhi:##abhi:1000:1:MeMyselfI:/home/abhi:/bin/bash

LDAP Server on Solaris x86 Platform

1 Create Domain

1.1 Set default domain

Assume that you are working on the following host: abhi with ip address 172.16.60.33

root@abhi # domainname testing.ldap
root@abhi# domainname > /etc/defaultdomain

1.2 Add host

Add the string abhi.testing.ldap to your hosts file.

root@abhi# vi /etc/inet/hosts
+--------------------------
| 172.16.60.33 abhi abhi.testing.ldap loghost

2 Install the LDAP server

The LDAP Server is installed with the following packages: IPLTdsu (IPLTnls, IPLTnspr (IPLTnss, IPLTjss), IPLTpldap).

Make sure that these packages are installed on your machine.

Insert the Solaris 10 DVD into the drive.

root@abhi# cd /cdrom/cdrom0/Solaris_10/Product

root@abhi# pkgadd -d . IPLTnspr
root@abhi# pkgadd -d . IPLTnss
root@abhi# pkgadd -d . IPLTjss
root@abhi# pkgadd -d . IPLTnls
root@abhi# pkgadd -d . IPLTpldap
root@abhi# pkgadd -d . IPLTdsu
root@abhi# pkgadd -d . IPLTdsr

root@abhi# cd /
root@abhi# eject cdrom

3 Create basic LDAP Server setup

root@abhi# directoryserver setup
Would you like to continue with configuration? [Yes]:
Press enter
Select the component you want to configure [1]:
press enter
Choose a configuration type [2]:
press enter
Specify the components you wish to configure [All]:
press enter
Specify the components you wish to configure [1, 2]:
press enter
Specify the components you wish to configure [1, 2]:
press enter
Computer name [abhi.testing.ldap]:
press enter
System User [nobody]:
press enter
System Group [nobody]:
press enter
Do you want to register this software with an existing iplanet
configuration directory server? [No]:
press enter
Do you want to use another directory to store your data? [No]:
press enter
Directory server network port [389]:
press enter
Directory server identifier [abhi]:
press enter
iPlanet configuration directory server administrator ID [admin]:
press enter
Password:
abhi123
Password (again):
abhi123
Suffix [dc=testing, dc=ldap]:
press enter
Directory Manager DN [cn=Directory Manager]:
press enter
Password:
abhi1234
Password (again):
abhi1234

Administration Domain [testing.ldap]:
press enter
Administration port [24459]:
5100
Run Administration Server as [root]:
press enter
Press return to continue...
root@abhi#


4 Prepare the Directory Server


root@abhi# cd /usr/lib/ldap
root@abhi# ./idsconfig
Do you wish to continue with server setup (y/n/h)? [n] y

Enter the iPlanet Directory Server's (iDS) hostname setup:
abhi
Enter the port number for iDS (h=help): [389]
press enter
Enter the directory manager DN: [cn=Directory Manager]
press enter
Enter passwd for cn=Directory Manager :
abhi1234
Enter the domainname to be served (h=help): [testing.ldap]
press enter

Enter LDAP Base DN (h=help): [dc=testing,dc=ldap]
press enter
Enter the profile name (h=help): [default]
press enter
Default server list (h=help): [172.16.60.33]
press enter
Preferred server list (h=help):
press enter

Choose desired search scope (one, sub, h-help): [one]
press enter
Choose Credential level [h=help]: [1]
2
Choose Authentication Method (h=help): [1]
2
Do you want to add another Authentication Method?
n
Do you want the clients to follow referrals (y/n/h)? [n]
press enter

Do you want to modify the server timelimit value (y/n/h)? [n]
press enter
Do you want to modify the server sizelimit value (y/n/h)? [n]
press enter
Do you want to store passwords in "crypt" format (y/n/h)? [n] y
Do you want to setup a Service Authentication Methods (y/n/h)? [n]
press enter

Client search time limit in seconds (h=help): [30]
press enter
Profile Time To Live in seconds (h=help): [43200]
press enter
Bind time limit in seconds (h=help): [10]
press enter
Do you wish to setup Service Search Descriptors (y/n/h)? [n]
press enter
Enter config value to change (1-19 0=commit changes) [0]
press enter

Enter DN for proxy agent: [cn=proxyagent,ou=profile,
dc=testing,dc=ldap]
press enter
Enter passwd for proxyagent:
proxy
Re-enter passwd:
proxy
WARNING: About to start committing change. (y=continue, n=EXIT)
y

root@abhi#

5 Configure first LDAP client


5.1 Create client system description (ldif file)
On the LDAP server.
root@abhi# vi /tmp/host1.ldif
dn: cn=host1,ou=hosts,dc=testing,dc=ldap
changetype: add
cn: host1
iphostnumber: 172.16.60.34
objectclass: top
objectclass: device
objectclass: ipHost

5.2 Load ldif file in LDAP server
ldis stands for LDAP data interchange format.
On the LDAP server.
root@abhi# ldapmodify -c \
> -D "cn=directory manager" \
> -w abhi1234 \
> -f /tmp/host1.ldif

5.3 Set default domain on client
On the LDAP client.
client # domainname testing.ldap
client # domainname > /etc/defaultdomain

5.4 Add server to hosts file
Add the string abhi.testing.ldap to your hosts file.
On the LDAP client.
client # vi /etc/inet/hosts
+--------------------------
| 172.16.60.33 abhi abhi.testing.ldap loghost

5.5 Configure first client as a LDAP Client

client # ldapclient \
> -v init \
> -a proxypassword=proxy \
> -a proxydn=cn=proxyagent,ou=profile,dc=testing,dc=ldap \
> -a domainname=testing.ldap \
> 172.16.60.33

6 Populate LDAP databases

Edit /etc/hosts on the client so that it only contains the hosts you want to store in LDAP.
client # vi /etc/hosts
client # ldapaddent \
> -D "cn=directory manager" \
> -w abhi1234 \
> -a simple \
> -f /etc/hosts hosts

6.1 Check hosts database
client # ldaplist hosts

6.2 Populate passwd database
client # ldapaddent \
> -D "cn=directory manager" \
> -w abhi1234 \
> -a simple \
> -f /etc/passwd \
> passwd

client # ldapaddent \
> -D "cn=directory manager" \
> -w abhi1234 \
> -a simple \
> -f /etc/shadow \
> shadow


7 Listing content of LDAP server


client # ldaplist
client # ldaplist passwd
client # ldaplist hosts


8 Configure all other clients


All other clients can be configured through:


8.1 Set default domain


client # domainname testing.ldap

client # domainname > /etc/defaultdomain

8.2 Add LDAP client to hosts file
client # vi /etc/inet/hosts
+--------------------------
| 172.16.60.x clientname clientname.testing.ldap loghost

8.3 Configure as LDAP Client
clientname # ldapclient \
> -v init \
> -a proxypassword=proxy \
> -a proxydn=cn=proxyagent,ou=profile,dc=testing,dc=ldap \
> -a domainname=testing.ldap \
> 172.16.60.33

Tuesday, December 21, 2010

How to Configure DataGuard On Oracle10g

For all the DBA’s of MoonUp Infotech and All the DBA’s all along the world.
I named my Primary database as "primary" and its host as "abhi1", while my Physical Standby database as "standby" and its host as "abhi2".



Setting Up Oracle Data Guard (Physical Standby Database)

1. Turn on archiving on the Primary database

[root@abhi1]# su - oracle
[oracle@abhi1]$ export ORACLE_SID=primary
[oracle@abhi1]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 21 14:20:03 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>startup mount
ORACLE instance started.

Total System Global Area 251658240 bytes
Fixed Size 1289964 bytes
Variable Size 125829396 bytes
Database Buffers 117440512 bytes
Redo Buffers 7098368 bytes

Database mounted.

SQL> alter database archivelog;

System altered.

SQL> alter database open;

System altered.



2. Gather necessary files to create a physical standby database and perform an RMAN backup

2.1 Create a staging directory on Primary and Standby host
[oracle@abhi1 ~]$ mkdir -p /u0/stage
[oracle@abhi1 ~]$

2.2 Create a copy of the init.ora (pfile)
SQL> create pfile='/u0/stage/initprimary.ora' from spfile;

2.3 Backup the database including archivelogs and create a backup of the current controlfile for standby database

[oracle@abhi1 ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Mon Dec 21 14:54:14 2010

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

connected to target database: PRIMARY (DBID=3316445735)

RMAN> run { allocate channel c1 type disk;
2> backup database format '/u0/stage/db%U'
3> plus archivelog format '/u0/stage/arc%U';
4> backup current controlfile for standby format '/u0/stage/ctl%U';
5> }

2.4 Copy *.ora files from $ORACLE_HOME/network/admin to staging directory
[oracle@abhi1 ~]$ cd $ORACLE_HOME/network/admin
[oracle@abhi1 admin]$ cp *.ora /u0/stage/

2.5 Copy all the files in the Primary's staging directory to Standby node
[oracle@abhi1 ~]$ scp /u0/stage/* oracle@abhi2:/u0/stage/


3. Configure Net Services on the Standby
[oracle@abhi2 admin]$ cat listener.ora
# listener.ora Network Configuration File: /opt/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = abhi2.seer-technologies.com)(PORT = 1521))
)

[oracle@abhi2 admin]$
[oracle@abhi2 admin]$
[oracle@abhi2 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PRIMARY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = abhi1.seer-technologies.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = primary)
)
)

STANDBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = abhi2.seer-technologies.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = standby)
)
)

[oracle@abhi2 admin]$

4. Create a Physical Standby database

4.1 Create password file. Ensure that the password is the same the Primary database SYS password.

[oracle@abhi2 admin]$ cd $ORACLE_HOME/dbs
[oracle@abhi2 dbs]$ ls
hc_primary.dat initdw.ora init.ora isnapcf_primary.f
[oracle@abhi2 dbs]$
[oracle@abhi2 dbs]$ orapwd file=orapwStandby password=oracle

4.2 Copy and edit init.ora for standby
[oracle@abhi2 ~]$ cd /u0/stage/
[oracle@abhi2 stage]$ cp initprimary.ora $ORACLE_HOME/dbs/initstandby.ora

###########################
#below is the copy of my initstandby.ora:
###########################

standby.__db_cache_size=171966464
standby.__java_pool_size=4194304
standby.__large_pool_size=4194304
standby.__shared_pool_size=96468992
standby.__streams_pool_size=0
*.audit_file_dest='/opt/oracle/admin/standby/adump'
*.background_dump_dest='/opt/oracle/admin/standby/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/opt/oracle/oradata/standby/control01.ctl','/opt/oracle/oradata/standby/control02.ctl','/opt/oracle/oradata/standby/control03.ctl'
*.core_dump_dest='/opt/oracle/admin/standby/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='primary'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.job_queue_processes=10
*.log_archive_dest_1='location=/u0/oradata/archive/'
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/opt/oracle/admin/standby/udump'

db_unique_name='standby'
instance_name='standby'

log_archive_config='dg_config=(standby,primary)'
log_archive_dest_2='service=primary valid_for=(online_logfiles,primary_role) db_unique_name=primary'
db_file_name_convert='/opt/oracle/oradata/primary/','/opt/oracle/oradata/standby/'
log_file_name_convert='/opt/oracle/oradata/primary/','/opt/oracle/oradata/standby/'
standby_file_management=auto
fal_server='primary'
fal_client='standby'
service_names='standby'

4.3 Create required directories
[oracle@abhi2 dbs]$ mkdir -p /opt/oracle/oradata/standby/
[oracle@abhi2 dbs]$ mkdir -p /opt/oracle/admin/standby/adump
[oracle@abhi2 dbs]$ mkdir -p /opt/oracle/admin/standby/bdump
[oracle@abhi2 dbs]$ mkdir -p /opt/oracle/admin/standby/cdump
[oracle@abhi2 dbs]$ mkdir -p /opt/oracle/admin/standby/udump
[oracle@abhi2 dbs]$

4.4 Create an spfile and start the database without mounting the controlfile
[oracle@abhi2 dbs]$ export ORACLE_SID=standby
[oracle@abhi2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 21 19:40:56 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> create spfile from pfile;

File created.

SQL>
SQL> startup nomount
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1267044 bytes
Variable Size 104860316 bytes
Database Buffers 171966464 bytes
Redo Buffers 7118848 bytes
SQL>

4.5 Duplicate the Primary database using RMAN
[oracle@abhi2 dbs]$ rman target sys/oracle@primary auxiliary /

Recovery Manager: Release 10.2.0.4.0 - Production on Mon Dec 21 19:47:50 2010

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

connected to target database: PRIMARY (DBID=3316445735)
connected to auxiliary database: STANDBY (not mounted)

RMAN> duplicate target database for standby;


NOTE: During my RMAN restoration, I encountered these errors:

sql statement: alter database mount standby database
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/01/2010 19:49:33
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of sql command on clone_default channel at 09/01/2010 19:49:33
RMAN-11003: failure during parse/execution of SQL statement: alter database mount standby database
ORA-01103: database name 'PRIMARY' in control file is not 'STANDBY'

To fix this error, I changed the db_name parameter of the standby database from "standby" to "primary". As per Dataguard documentation, db_name parameter must be the same on the primary and standby databases.

4.6 Add Standby redo logs
SQL> alter database add standby logfile
2 group 4 ('/opt/oracle/oradata/standby/standbyredo01.log') size 50M,
3 group 5 ('/opt/oracle/oradata/standby/standbyredo02.log') size 50M,
4 group 6 ('/opt/oracle/oradata/standby/standbyredo03.log') size 50M,
5* group 7 ('/opt/oracle/oradata/standby/standbyredo04.log') size 50M
SQL> /


SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
3 ONLINE /opt/oracle/oradata/standby/redo03.log NO
2 ONLINE /opt/oracle/oradata/standby/redo02.log NO
1 ONLINE /opt/oracle/oradata/standby/redo01.log NO
4 STANDBY /opt/oracle/oradata/standby/standbyredo01.log NO
5 STANDBY /opt/oracle/oradata/standby/standbyredo02.log NO
6 STANDBY /opt/oracle/oradata/standby/standbyredo03.log NO
7 STANDBY /opt/oracle/oradata/standby/standbyredo04.log NO

7 rows selected.

SQL> select * from v$standby_log;

GROUP# DBID THREAD# SEQUENCE# BYTES USED ARC STATUS FIRST_CHANGE# FIRST_TIM LAST_CHANGE# LAST_TIME
---------- ---------------------------------------- ---------- ---------- ---------- ---------- --- ---------- ------------- --------- ------------ ---------
4 UNASSIGNED 0 0 52428800 512 YES UNASSIGNED 0 0
5 UNASSIGNED 0 0 52428800 512 YES UNASSIGNED 0 0
6 UNASSIGNED 0 0 52428800 512 YES UNASSIGNED 0 0
7 UNASSIGNED 0 0 52428800 512 YES UNASSIGNED 0 0


4.7 Start managed recovery and Real-time apply on the standby database
SQL> alter database recover managed standby database using current logfile disconnect;

Database altered.


5. Configure Primary Database for Dataguard
5.1 Modify initialization parameters
SQL>
SQL> alter system set log_archive_config='dg_config=(standby,primary)' scope=both;

System altered.

SQL> alter system set log_archive_dest_2='service=standby valid_for=online_logfiles,primary_role)
2 db_unique_name=standby' scope=both;

System altered.

SQL> alter system set db_file_name_convert='/opt/oracle/oradata/standby/','/opt/oracle/oradata/primary/' scope=spfile;

System altered.

SQL> alter system set log_file_name_convert='/opt/oracle/oradata/standby/','/opt/oracle/oradata/primary/' scope=spfile;

System altered.

SQL> alter system set standby_file_management=auto scope=both;

System altered.

SQL> alter system set fal_server='standby' scope=both;

System altered.

SQL> alter system set fal_client='primary' scope=both;

System altered.

SQL> alter system set service_names=primary scope=both;

System altered.


5.2 Add Standby redo logs
SQL> alter database add standby logfile group 4
2 ('/opt/oracle/oradata/primary/standbyredo01.log')
3 size 50M,
4 group 5 ('/opt/oracle/oradata/primary/standbyredo02.log')
5 size 50M,
6 group 6 ('/opt/oracle/oradata/primary/standbyredo03.log')
7 size 50M,
8 group 7 ('/opt/oracle/oradata/primary/standbyredo04.log');




6. Verify Data Guard Configuration
6.1 Query v$archived_log view to identify existing files in the archived redo log


SQL> select sequence#, first_time, next_time
2 from v$archived_log
3 order by sequence#;


6.2 Force a redo log switch on the Primary database
SQL> alter system switch logfile;


6.3 Re-query v$archived_log view on the Physical Standby database to verify if the redo data was received and archived on the standby database
SQL> select sequence#, first_time, next_time, applied

2 from v$archived_log
3 order by sequence#;

Note: you must see that archived logs are being applied on the physical standby, this indicates a successful dataguard configuration.


Tips:
Checking database alert log helps a lot when configuring and troubleshooting Oracle Data Guard.

Monday, February 22, 2010

How to configure BSNL broadband on Solaris 10 x86 platform

For configurong BSNL Broadband on solaris 10 u need following packages to b installed:

SUNWpppd - Solaris PPP Device Drivers.
SUNWpppdr - Solaris PPP configuration files.
SUNWpppdt - Solaris PPP Tunneling.
SUNWpppdu - Solaris PPP daemon and utilities.
==>Install these packages from Solaris DVD

There will be a file myisp.tmpl in /etc/ppp/peers directory. copy the file to a filename /etc/ppp/peers/bsnl.
# cp /etc/ppp/peers/myisp.tmpl /etc/ppp/peers/bsnl

Edit /etc/ppp/peers/bsnl file,
connect "/usr/bin/chat -f /etc/ppp/myisp-chat" # dial into ISP.

sppptun
plugin pppoe.so
connect "/usr/lib/inet/pppoec INTERFACE"
user USERNAME # my account name at my ISP
remotename bsnl # name of the ISP; for pap-secrets
noauth # do not authenticate the ISP's identity (client)
noipdefault # assume no IP address; get it from ISP
defaultroute # install default route; ISP is Internet gateway
updetach # log errors and CONNECT string to invoker
noccp # ISP doesn't support free compression

==>In above file the INTERFACE should be your ethernet interface name and USERNAME is your broadband user name.

Now, edit the two configuration files
/etc/ppp/pap-secrets
/etc/ppp/chap-secrets
add entry in both of files as:
USERNAME bsnl PASSWORD
This entry should be tab separated

==>Where USERNAME is your broadband username and PASSWORD is you broadband password.

!!Your configuration is almost done.

Now for connecting.
#/usr/sbin/sppptun plumb pppoe INTERFACENAME
#/usr/sbin/sppptun plumb pppoed INTERFACENAME
#/usr/bin/pppd debug call bsnl

Enable your dns/client
#svcadm enable dns/client

Now, for connecting everytime make a script as
#!/usr/bin/bash
ifconfig INTERFACENAME plumb
pkill -9 pppd
/usr/sbin/sppptun plumb pppoe INTERFACENAME
/usr/sbin/sppptun plumb pppoed INTERFACENAME
sleep 5
/usr/bin/pppd debug call bsnl

Wednesday, February 10, 2010

Installation of Solaris 10 on x86 Platform

Through this page you can easily
install solaris 10 on x86 platform

Page:

Abhi's Solaris Installation Page

ORACLE 10G Installation on Solaris 10 x86 platform

groupadd dba
groupadd oinstall
useradd -md /export/home/oracle -g dba -G oinstall -s /bin/bash oracle

vi /etc/profile
export PATH=/usr/bin:/usr/sbin:/usr/sfw/bin:/user/openwin/bin:/usr/ucb:/usr/ccs/bin:$PATH
source /etc/profile

# Do following configuration for setting kernel parameters to increase memory size
vi /etc/system
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semmni=100
set semsys:seminfo_semvmx=32767
set noexec_user_stack=1
reboot

su - oracle
# Extract the cpio file of Oracle Software
cpio -icvdB < /Desktop/---Solaris Software file---

vi .profile
#oracle setting
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Select the appropriate ORACLE_BASE
ORACLE_BASE=/export/home/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID= Any SID u wanna Give; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
DISPLAY=:0.0;export DISPLAY
source .profile

#Create Base Directory 4 Oracle
cd /export/home
mkdir oracle
chown oracle:dba oracle


cd /Disk1/install
vi oraparam.ini
search version in it and write 5.10 after 5.9 comma separated

cd ..
./runInstaller ({first run 'xhost +' from super-user})


sqlplus /nolog
connect sys/passwd as sysdba
show user
startup
quit