Wednesday, March 20, 2013

Oracle: Create User

reference: http://docs.oracle.com/cd/B10500_01/server.920/a96521/privs.htm#21065

Determine Current SID in SQL PLUS

SELECT * from global_name;

Create User: 
CREATE USER james
    IDENTIFIED BY letmein
    DEFAULT TABLESPACE userspace
    TEMPORARY TABLESPACE temp;

grant CREATE VIEW, CREATE TABLE,  CREATE SYNONYM, CREATE PROCEDURE, UNLIMITED TABLESPACE, CREATE SEQUENCE to james;

SELECT GRANTEE, TABLE_NAME, COLUMN_NAME, PRIVILEGE
    FROM DBA_COL_PRIVS;

SELECT * FROM DBA_SYS_PRIVS where grantee = 'JAMES';
select * from user_sys_privs where username = 'JAMES';
select * from session_privs;


select username from dba_users where username = 'JAMES';


connection string:
jdbc:oracle:thin:@dw.my.company.com:1521:MYSID

Tuesday, March 19, 2013

Oracle force to drop database

SQL> STARTUP FORCE MOUNT
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

Friday, March 15, 2013

Oracle Database: reset sys/sysdba password

sqlplus /nolog
connect / as sysdba
Once connected, you can change the SYS password to something you know:
ALTER USER sys IDENTIFIED BY new_password;

Thursday, March 14, 2013

Oracle 11g: Inatallation on Solaris 11 Sparc

Oracle 11g Installation Guide

 http://docs.oracle.com/cd/E11882_01/install.112/e24351/toc.htm

System Preparation:

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=34397

Wednesday, March 13, 2013

Sun M4000 Configure 2 Dynamic Domains

in Sun M4000,

To use a PSB in your midrange or high-end server, the hardware resources on the board must be logically divided and reconfigured as eXtended System Boards (XSBs). There are two modes of XSBs:

    Uni-XSB

        A PSB logically undivided and configured into one XSB

        Contains all the resources on the board: 4 CPUs, 32 DIMMs, and I/O on a midrange and high-end server; 1 CPU, 8 DIMMs, and I/O on an entry-level server.

    Quad-XSB (midrange and high-end servers only)

        A PSB logically divided and configured into four XSBs

        Each of the four XSBs contains one-quarter of the total board resources: 1 CPU, 8 DIMMs, and I/O. On a midrange server, only two XSBs have I/O.

to change XSB mode, you have to power off all running domains.

show current mode:
XSCF> showfru -a sb
Device  Location    XSB Mode        Memory Mirror Mode 
sb      00          Uni             no                 
XSCF>
XSCF> showboards -a
XSB  DID(LSB) Assignment  Pwr  Conn Conf Test    Fault   
---- -------- ----------- ---- ---- ---- ------- --------
00-0 SP       Unavailable n    n    n    Unknown Normal  

Change current mode

XSCF> setupfru -x 4 sb 0
SB#00 is currently in use.
XSCF> deleteboard -c unassign 0-0
XSB#00-0 will be unassigned from domain immediately. Continue?[y|n] :y
XSCF>

XSCF> setupfru -x 4 sb 0
Operation has completed. However, a configuration error was detected.

XSCF> showfru -a sb
Device  Location    XSB Mode        Memory Mirror Mode 
sb      00          Quad            no             

XSCF>  showboards -a
XSB  DID(LSB) Assignment  Pwr  Conn Conf Test    Fault   
---- -------- ----------- ---- ---- ---- ------- --------
00-0 SP       Unavailable n    n    n    Unknown Normal  
00-1 SP       Unavailable n    n    n    Unknown Normal  
00-2 SP       Unavailable n    n    n    Unmount Normal  
00-3 SP       Unavailable n    n    n    Unmount Normal  

XSCF> setdcl -d 0 -a 0=00-0
XSCF> addboard -c assign -d 0 00-0
XSB#00-0 will be assigned to DomainID 0. Continue?[y|n] :y
XSCF> showboards -a
XSB  DID(LSB) Assignment  Pwr  Conn Conf Test    Fault   
---- -------- ----------- ---- ---- ---- ------- --------
00-0 00(00)   Assigned    n    n    n    Unknown Normal  
00-1 SP       Unavailable n    n    n    Unknown Normal  
00-2 SP       Unavailable n    n    n    Unmount Normal  
00-3 SP       Unavailable n    n    n    Unmount Normal  
XSCF> setdcl -d 1 -a 1=00-1
XSCF> addboard -c assign -d 1 00-1
XSB#00-1 will be assigned to DomainID 1. Continue?[y|n] :y
XSCF> showboards -a
XSB  DID(LSB) Assignment  Pwr  Conn Conf Test    Fault   
---- -------- ----------- ---- ---- ---- ------- --------
00-0 00(00)   Assigned    n    n    n    Unknown Normal  
00-1 01(01)   Assigned    n    n    n    Unknown Normal  
00-2 SP       Unavailable n    n    n    Unmount Normal  
00-3 SP       Unavailable n    n    n    Unmount Normal  

XSCF>  showdcl -v -d 0 
DID   LSB   XSB   Status   No-Mem   No-IO    Float    Cfg-policy
00                Powered Off                         FRU     
      00    00-0           False    False    False            
      01    -                                                 
      02    -                                                 
      03    -                                                 
      04    -                                                 
      05    -                                                 
      06    -                                                 
      07    -                                                 
      08    -                                                 
      09    -                                                 
      10    -                                                 
      11    -                                                 
      12    -                                                 
      13    -                                                 
      14    -                                                 
      15    -                                                 
XSCF> setdcl -d 0 -a 0=00-0
XSCF> setdcl -d 0 -a 1=00-1
XSCF> showdcl -v -d 0
DID   LSB   XSB   Status   No-Mem   No-IO    Float    Cfg-policy
00                Powered Off                         FRU     
      00    00-0           False    False    False            
      01    00-1           False    False    False            
      02    -                                                 
      03    -                                                 
      04    -                                                 
      05    -                                                 
      06    -                                                 
      07    -                                                 
      08    -                                                 
      09    -                                                 

      10    -                                                 
      11    -                                                 
      12    -                                                 
      13    -                                                 
      14    -                                                 
      15    -                                                 
XSCF> addboard -c assign -d 0 00-0 00-1
XSB#00-0 will be assigned to DomainID 0. Continue?[y|n] :y
XSB#00-1 will be assigned to DomainID 0. Continue?[y|n] :y
XSCF>
console -d 0









#.

wget thru proxy

export http_proxy=http://proxy.goweekend.ca:8888
wget http://docs.oracle.com/cd/E19580-01/E25381/E25381.pdf

Solaris Install GNOME


pkg install slim_install
svcadm enable gdm


startx

Tuesday, March 12, 2013

Solaris 11: Custom Oracle Solaris 11 Installation Image

https://blogs.oracle.com/jimlaurent/entry/building_a_solaris_11_repository

Create local Solaris 11 repository
The easiest way is to download the ISO image, burn to a DVD and insert into your DVD drive.  Then as root:

  • pkg set-publisher -G '*' -g file:///cdrom/sol11repo_full/repo solaris
 mount -F hsfs sol-11-11-repo-full.iso /mnt

  • zfs create -o atime=off -o compression=on rpool/export/repoSolaris11
  • rsync -aP /mnt/repo /export/repoSolaris11
  • pkgrepo -s /export/repoSolaris11/repo refresh
  • pkg set-publisher -G '*' -g /export/repoSolaris11/repo solaris
In my case, I put the repository on Linux NFS Server

pkg set-publisher -G '*' -g file:///mnt solaris



Custom Oracle Solaris 11 Installation Image

http://docs.oracle.com/cd/E23824_01/html/E21800/distroconst.html#scrolltocCreate ZFS: http://docs.oracle.com/cd/E19082-01/817-2271/gamnq/index.html
On Solaris 11 server, install distribution-constructor

# pkg install  distribution-constructor
# zfs create rpool/ai
# cd /root
# cp /usr/share/distro_const/dc_ai_sparc.xml .

     <target name="desired">
      <logical>
        <zpool name="rpool" action="use_existing">
          <filesystem name="rpool/ai" action="preserve"/>
        </zpool>
      </logical>
    </target>

        <publisher name="solaris">
          <origin name="file:///mnt"/>
          <!--
          <origin name="http://127.15.10.70/solarisrepo/repo"/>
          If mirrors for this publisher need to be set, specify them here.
          -->
          <!-- Uncomment before using
          <mirror name="mirror.example.com"></mirror>
          -->
        </publisher>

Modify dc_ai_sparc.xml

Below are the commands to create bootable image and iso
==========================================================================

# distro_const build /root/dc_ai_sparc.xml/usr/bin/dd if=/rpool/rpool/ai/build_data/boot_archive/platform/sun4u/lib/fs/hsfss/bootblk of=/rpool/rpool/ai/build_data/pkg_image/boot/hsfs.bootblock bs=1b oseekk=1 count=15 conv=sync

/usr/bin/mkisofs -quiet -o /rpool/rpool/ai/media/Oracle_Solaris_AI_SPARC.iso -G //rpool/rpool/ai/build_data/pkg_image/boot/hsfs.bootblock -B ... -N -l -ldots -R -D -volset myhost-2013-03-12T15:55:49.827736 -V Oracle_Solaris_AI_SPARC /rpool//rpool/ai/build_data/pkg_image

Monday, March 11, 2013

Solaris enable root login

1) Modify PermitRootLogin to yes in /etc/ssh/sshd_config.
2) Comment out the “CONSOLE=/dev/console” line in /etc/default/login.
3) Remove “;type=role” from the root entry in /etc/user_attr.

Solaris Sparc Mount ISO file

http://www.tech-recipes.com/rx/218/mount-an-iso-image-on-a-solaris-filesystem-with-lofiadm/
 
Given an ISO image in /export/temp/software.iso, a loopback file device (/dev/lofi/1) is created with the following command:
lofiadm -a /export/temp/software.iso /dev/lofi/1
The lofi device creates a block device version of a file. This block device can be mounted to /mnt with the following command:
mount -F hsfs -o ro /dev/lofi/1 /mnt
These commands can be combined into a single command:
mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt

Friday, March 8, 2013

Solaris Eject DVD

Solaris 10

#eject -n
        fd -> floppy0
        fd0 -> floppy0
        fd1 -> floppy1
        diskette -> floppy0
        diskette0 -> floppy0
        diskette1 -> floppy1
        rdiskette -> floppy0
        rdiskette0 -> floppy0
        rdiskette1 -> floppy1
        cd -> cdrom0
        cd0 -> cdrom0
        cd1 -> cdrom1
        sr -> cdrom0
        sr0 -> cdrom0
        /dev/sr0 -> cdrom0
        /dev/rsr0 -> cdrom0
        cdrom0 -> /vol/dev/rdsk/c0t6d0/sol_9_sparc
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
# eject cdrom0 
 
Solaris 11
 
# eject -l

# eject

Combine Solaris Automated Install and Repository on one image

Quoted from  http://notallmicrosoft.blogspot.ca/2012/03/combine-solaris-automated-install-and.html
Combine Solaris Automated Install and Repository on one image

 

 Copy Oracle Solaris 11 11/11 Automated Installer from ISO to disk:

# mount -F hsfs sol-11-1111-ai-x86.iso /mnt
# cd /mnt
# mkdir /var/tmp/AIboot
# find . -depth -print | cpio -pdm /var/tmp/AIboot
# cd /
# umount /mnt

Copy Oracle Solaris 11 11/11 Repository Image from ISO to disk:
# mount -F hsfs sol-11-1111-repo-full.iso /mnt
# cd /mnt
# rsync -aP /mnt/repo/ /var/tmp/AIboot/repoSolaris11
# cd /
# umount /mnt

Check it and edit default manifest so that is uses local repository:
# du -hs /var/tmp/AIboot
7.0G /var/tmp/AIboot

# ls /var/tmp/AIboot

auto_install      devices           mnt               repoSolaris11     solaris.zlib
bin               export            platform          root              solarismisc.zlib
boot              home              proc              save              system
dev               jack              reconfigure       sbin              tmp

Edit /var/tmp/AIboot/auto_install/default.xml

             <publisher name="solaris">
                     <origin name="http://pkg.oracle.com/solaris/release"/>
             </publisher>

Change to:

             <publisher name="solaris">
                     <origin name="file:///.cdrom/repoSolaris11"/>
             </publisher>

Create a new ISO:
# mkisofs -o /var/tmp/output.iso -b boot/grub/stage2_eltorito \
-c .catalog -no-emul-boot -boot-load-size 4 \
-boot-info-table -N -R -U -allow-multidot -no-iso-translate \
-cache-inodes -iso-level 4 -d -D -V Solaris11 /var/tmp/AIboot

Warning: Creating ISO-9660:1999 (version 2) filesystem.
Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS.
Size of boot image is 4 sectors -> No emulation
Size of boot image is 4 sectors -> No emulation
0.99% done, estimate finish Fri Mar 9 13:23:05 2012
1.13% done, estimate finish Fri Mar 9 13:22:53 2012
...
99.83% done, estimate finish Fri Mar 9 13:37:07 2012
99.97% done, estimate finish Fri Mar 9 13:37:06 2012
Total translation table size: 2048
Total rockridge attributes bytes: 36023282
Total directory bytes: 68673536
Path table size(bytes): 136082
Max brk space used 10144000
3530910 extents written (6896 MB)

The above iso then was used to install Solaris 11 on VirtaulBox.

SPARC Console Journal

M4000

#. switch to XSCF mode from console
XSCF > console -d 0   # switch to domain console


XSCF> showdomainstatus -d 0

XSCF> poweron -d 0
DomainIDs to power on:00
Continue? [y|n] :y
00 :Powering on

*Note*
 This command only issues the instruction to power-on.
 The result of the instruction can be checked by the "showlogs power".
XSCF> console -d 0

send break signal to domain
XSCF> sendbreak -y -d 0
Send break signal to DomainID 0?[y|n] :y


in domain console, after system up and login as root issue below command to enter ok prompt

init 0

# Mar  8 09:22:42  ip: ip_create_dl: hw addr length = 0
svc.startd: The system is coming down.  Please wait.
svc.startd: 112 system services are now being stopped.
Mar  8 09:22:44  scsi: WARNING: /pci@3,700000/SUNW,qlc@0/fp@0,0/ssd@w20570080e53683c6,1f (ssd0):
Mar  8 09:22:44         Corrupt label; wrong magic number
Mar  8 09:22:48  rpc.metad: Terminated
Mar  8 09:22:49  ip: ip_create_dl: hw addr length = 0
Mar  8 09:22:53  syslogd: going down on signal 15
svc.startd: The system is down.
syncing file systems... done
Program terminated
{6} ok boot cdrom
Resetting...

 {d} ok show-disks
a) /ramdisk-root
b) /pci@3,700000/SUNW,qlc@0/fp@0,0/disk
c) /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk
d) /iscsi-hba/disk
q) NO SELECTION
Enter Selection, q to quit: c
/pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
         for creating devalias mydev for /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk
{d} ok nvalias mydev /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk
{d} okshow-devs
{d} ok boot mydev - install
Resetting...




Thursday, March 7, 2013

Open AM Implementation

OpenAM Installation

http://docs.forgerock.org/en/openam/10.1.0/install-guide/index.html

Using Open Ldap
http://linuxrelatedjotter.blogspot.ca/2012/07/openam-with-openldap-as-user-store-on.html

Tuesday, March 5, 2013

Windows 2008: How to manually extend the evaluation period

How to manually extend the evaluation period

When the initial 60-day evaluation period nears its end, you can run the Slmgr.vbs script to reset the evaluation period. To do this, follow these steps:
  1. Click Start, and then click Command Prompt.
  2. Type slmgr.vbs -dli, and then press ENTER to check the current status of your evaluation period.
  3. To reset the evaluation period, type slmgr.vbs –rearm, and then press ENTER.
  4. Restart the computer.

Oracle 11g Create first Database


http://docs.oracle.com/cd/B28359_01/server.111/b28310/create003.htm

SUN M4000 XSCF Commands


http://solaris-docs.blogspot.ca/2009/09/logon-to-alom-of-sun-m4000.html

Monday, March 4, 2013

Sparc Solaris Reboot Console Output

# reboot
Mar  4 14:49:17  reboot: rebooted by root
Mar  4 14:49:18  syslogd: going down on signal 15
ip_create_dl: hw addr length = 0
Mar  4 14:49:18 /usr/lib/snmp/snmpdx: received signal 15
Mar  4 14:49:18 rpc.metad: Terminated
syncing file systems... done
rebooting...
Resetting...
POST Sequence 01 CPU Check
POST Sequence 02 Banner
LSB#00 (XSB#00-0): POST 2.17.0 (2011/11/17 10:29)
POST Sequence 03 Fatal Check
POST Sequence 04 CPU Register
POST Sequence 05 STICK
POST Sequence 06 MMU
POST Sequence 07 Memory Initialize
POST Sequence 08 Memory
POST Sequence 09 Raw UE In Cache
POST Sequence 0A Floating Point Unit
POST Sequence 0B SC
POST Sequence 0C Cacheable Instruction
POST Sequence 0D Softint
POST Sequence 0E CPU Cross Call
POST Sequence 0F CMU-CH
POST Sequence 10 PCI-CH
POST Sequence 11 Master Device
POST Sequence 12 DSCP
POST Sequence 13 SC Check Before STICK Diag
POST Sequence 14 STICK Stop
POST Sequence 15 STICK Start
POST Sequence 16 Error CPU Check
POST Sequence 17 System Configuration
POST Sequence 18 System Status Check
POST Sequence 19 System Status Check After Sync
POST Sequence 1A OpenBoot Start...
POST Sequence Complete.

SPARC Enterprise M4000 Server, using Domain console
Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, Oracle and/or its affiliates and Fujitsu Limited. All rights reserved.
OpenBoot 4.33.5.d, 65536 MB memory installed, Serial #102848270.
Ethernet address 0:10:e0:21:57:e, Host ID: 8621570e.



Rebooting with command: boot
Boot device: disk  File and args:
SunOS Release 5.10 Version Generic_147440-26 64-bit
Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
-
Hostname:

 console login:

Solaris Enable New NIC and configure permanent network


# dladm show-link
eri0    type: legacy    mtu: 1500       device: eri0 
qfe0    type: legacy    mtu: 1500       device: qfe0 
qfe1    type: legacy    mtu: 1500       device: qfe1 
qfe2    type: legacy    mtu: 1500       device: qfe2 
qfe3    type: legacy    mtu: 1500       device: qfe3 
bge0    type: non-vlan  mtu: 1500       device: bge0
# vi /etc/hostname.qfe0
192.168.84.3 netmask 255.255.255.0
# vi /etc/hostname.qfe1 
192.168.84.72 netmask 255.255.255.0
# vi /etc/inet/hosts
# Internet host table 
# 
127.0.0.1       localhost 
10.0.0.14       myhost
192.168.84.3       interface-2 
192.168.84.72       interface-3
For Solaris 10 11/06 and earlier releases:# vi /etc/inet/ipnodes
10.0.0.14 myhost
192.168.84.3       interface-2 
192.168.84.72       interface-3
 
 =======================================================================

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 137.15.210.12 netmask ffffff00 broadcast 137.15.210.255
        ether 0:21:28:e8:2:a6
sppp0: flags=10010008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4,FIXEDMTU> mtu 1500 index 3
        inet 10.1.1.2 --> 10.1.1.1 netmask ff000000
        ether 0:0:0:0:0:0

# prtconf -D |grep network
                    network, instance #0 (driver name: bge)
                    network, instance #1 (driver name: bge)

enable second NIC

# ifconfig bge1 plumb
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 137.15.210.12 netmask ffffff00 broadcast 137.15.210.255
        ether 0:21:28:e8:2:a6
bge1: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 0.0.0.0 netmask 0
        ether 0:21:28:e8:2:a7
sppp0: flags=10010008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4,FIXEDMTU> mtu 1500 index 3
        inet 10.1.1.2 --> 10.1.1.1 netmask ff000000
        ether 0:0:0:0:0:0

# ifconfig bge1 192.168.0.12 netmask 255.255.255.0 up
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 137.15.210.12 netmask ffffff00 broadcast 137.15.210.255
        ether 0:21:28:e8:2:a6
bge1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 192.168.0.12 netmask ffffff00 broadcast 192.168.0.255
        ether 0:21:28:e8:2:a7
sppp0: flags=10010008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4,FIXEDMTU> mtu 1500 index 3
        inet 10.1.1.2 --> 10.1.1.1 netmask ff000000
        ether 0:0:0:0:0:0

Solaris: Create New Partition

Script started on March  4, 2013 10:57:39 AM EST
# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN300G cyl 46873 alt 2 hd 20 sec 625>  solaris
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
       1. c0t1d0 <SUN300G cyl 46873 alt 2 hd 20 sec 625>  solaris
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
Specify disk (enter its number): 0
selecting c0t0d0: solaris
[disk formatted]
Warning: Current Disk has mounted partitions.
/dev/dsk/c0t0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c0t0d0s1 is currently used by swap. Please see swap(1M).


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
       3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Volume:  solaris
Current partition table (original):
Total disk cylinders available: 46873 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm     672 -  2685       12.00GB    (2014/0/0)   25175000
  1       swap    wu       0 -   671        4.01GB    (672/0/0)     8400000
  2     backup    wm       0 - 46872      279.38GB    (46873/0/0) 585912500
  3 unassigned    wm    2686 -  4699       12.00GB    (2014/0/0)   25175000
  4 unassigned    wm       0                0         (0/0/0)             0
  3 unassigned    wm    2686 -  4699       12.00GB    (2014/0/0)   25175000
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 1
Part      Tag    Flag     Cylinders         Size            Blocks
  1       swap    wu       0 -   671        4.01GB    (672/0/0)     8400000

Enter partition id tag[swap]:
Enter partition permission flags[wu]:
Enter new starting cyl[0]:
Enter partition size[8400000b, 672c, 671e, 4101.56mb, 4.01gb]: 8gb
partition> p
Volume:  solaris
Current partition table (unnamed):
Total disk cylinders available: 46873 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm     672 -  2685       12.00GB    (2014/0/0)   25175000
  1       swap    wu       0 -  1342        8.00GB    (1343/0/0)   16787500
  2     backup    wm       0 - 46872      279.38GB    (46873/0/0) 585912500
 1       swap    wu       0 -  1342        8.00GB    (1343/0/0)   16787500
  2     backup    wm       0 - 46872      279.38GB    (46873/0/0) 585912500
  3 unassigned    wm    2686 -  4699       12.00GB    (2014/0/0)   25175000
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 4
Part      Tag    Flag     Cylinders         Size            Blocks
  4 unassigned    wm       0                0         (0/0/0)             0

Enter partition id tag[unassigned]: usr2
`usr2' not expected.
Enter partition id tag[unassigned]: 4
`4' not expected.
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 4700
Enter partition size[0b, 0c, 4700e, 0.00mb, 0.00gb]: 80gb
partition> p
Volume:  solaris
Current partition table (unnamed):
olume:  solaris
Current partition table (unnamed):
Total disk cylinders available: 46873 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm     672 -  2685       12.00GB    (2014/0/0)   25175000
  1       swap    wu       0 -  1342        8.00GB    (1343/0/0)   16787500
  2     backup    wm       0 - 46872      279.38GB    (46873/0/0) 585912500
  3 unassigned    wm    2686 -  4699       12.00GB    (2014/0/0)   25175000
  4 unassigned    wm    4700 - 18121       80.00GB    (13422/0/0) 167775000
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> label
Ready to label disk, continue? y

partition> q


 # newfs /dev/rdsk/c0t0d0s5
newfs: construct a new file system /dev/rdsk/c0t0d0s5: (y/n)? y
Warning: 3116 sector(s) in last cylinder unallocated
/dev/rdsk/c0t0d0s5:     293612500 sectors in 47789 cylinders of 48 tracks, 128 s
ectors
        143365.5MB in 2987 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
...........................................................
super-block backups for last 10 cylinder groups at:
 292655264, 292753696, 292852128, 292950560, 293048992, 293147424, 293245856,

super-block backups for last 10 cylinder groups at:
 292655264, 292753696, 292852128, 292950560, 293048992, 293147424, 293245856,
 293344288, 293442720, 293541152
# newfs /dev/rdsk/c0t0d0s4
newfs: construct a new file system /dev/rdsk/c0t0d0s4: (y/n)? y
Warning: 5352 sector(s) in last cylinder unallocated
/dev/rdsk/c0t0d0s4:     167775000 sectors in 27308 cylinders of 48 tracks, 128 s
ectors
        81921.4MB in 1707 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
.................................
super-block backups for last 10 cylinder groups at:
 166826144, 166924576, 167023008, 167121440, 167219872, 167318304, 167416736,
 167515168, 167613600, 167712032
# mkdir /dbfs

 # cat /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c0t0d0s1       -       -       swap    -       no      -
/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      logging
/dev/dsk/c0t0d0s4       /dev/rdsk/c0t0d0s4      /usr2   ufs     1       no      logging
/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /dbfs   ufs     1       no      logging
/devices        -       /devices        devfs   -       no      -
sharefs -       /etc/dfs/sharetab       sharefs -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -



Friday, March 1, 2013

Oracle 11g Users

sqlplus / as sysdba on console

tables:
dba_users - all users from database
user_users - all users from schema

all_users - list users plus users having access to schema

desc dba_users;

select username, account_status, lock_date from dba_users;

Oracle 11g R2 Journal


dbca -  Database Configuration
netca - Configure Listner

dbca logs: /opt/oracle/cfgtoollogs/dbca/suzhou
db control file: 
/opt/oracle/oradata/suzhou
db files:
/opt/oracle/oradata/suzhou
redo logs:
/opt/oracle/oradata/suzhou

Database Information:
Global Database Name: suzhou.goweekend.ca
SID: aniuSuzhou
Server Parameter File name:/opt/oracle/product/11.2.0/dbhome_1/dbs/spfilesuzhou.ora

The Database Control URL is https://suzhou.goweekend.ca:5500/em

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /opt/oracle/product/11.2.0/dbhome_1/suzhou.goweekend.ca_suzhou/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.