MSol Connect
===========
Import-Module MSOnline
Connect-MsolService -Credential $cred
Get-MsolAccountSku
#ADD User No License on Office365
$upn = Get-Content .\upn-nolic.txt
foreach ($line in $upn) {
#ADD by sAMAccountName
#Get-ADUser -SearchBase "dc=domain,dc=local" -Filter { samaccountname -eq $line } |Select-Object DistinguishedName, GivenName, Surname, UserPrincipalName
#Set-MsolUserLicense -UserPrincipalName $line@domain.com -AddLicenses domain365:STANDARDWOFFPACK_FACULTY
#Set-MsolUser -UserPrincipalName $line@domain.com -UsageLocation "TH"
#ADD by UserPrincipalName
#Get-ADUser -SearchBase "dc=domain,dc=local" -Filter { UserPrincipalName -eq $line } |Select-Object DistinguishedName, GivenName, Surname, UserPrincipalName
#Set-MsolUser -UserPrincipalName $line -UsageLocation "TH"
#Set-MsolUserLicense -UserPrincipalName $line -AddLicenses domain365:STANDARDWOFFPACK_FACULTY
#Get-MsolUser -DomainName domain.com -SearchString $line | Select Displayname, UserPrincipalName, Licenses, LastDirSyncTime, UsageLocation
}
ActiveDirectory Connect
==================
$UN="test."
Get-ADUser -SearchBase "dc=domain,dc=local" -Filter { samaccountname -eq $UN } | Select-Object DistinguishedName, GivenName, Surname, UserPrincipalName
Get-ADUser $UN -Properties *
Get-ADUser $UN -Properties * | Select-Object UserPrincipalName
Get-ADUser -SearchBase "ou=itc,ou=nida,dc=domain,dc=local" -Filter { samaccountname -eq $UN } -Properties * | Select-Object UserPrincipalName, optionalEmail, mail,DistinguishedName
Get-ADUser -SearchBase "ou=itc,ou=users,dc=domain,dc=local" -Filter * -Properties * | Select-Object SamaccountName, mail, optionalEmail
Set Attribute ADuser
===============
Get-ADUser -SearchBase "ou=subouname,ou=ouname,dc=domain,dc=local" -Properties * -Filter {samaccountname -like "su*"} | Set-ADUser -MobilePhone " "
Tuesday, August 18, 2015
Friday, August 14, 2015
Oracle AMM
memory_max_target >= memory_target>=sga_max_size>=sga_target
example:
ALTER SYSTEM SET memory_max_target='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET memory_target='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET db_cache_size='4194304' SCOPE=SPFILE;
ALTER SYSTEM SET java_pool_size='0' SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target='0' SCOPE=SPFILE;
ALTER SYSTEM SET shared_pool_size='0' SCOPE=SPFILE;
ALTER SYSTEM SET sga_max_size='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET sga_target='0' SCOPE=SPFILE;
'0 = auto'
example:
ALTER SYSTEM SET memory_max_target='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET memory_target='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET db_cache_size='4194304' SCOPE=SPFILE;
ALTER SYSTEM SET java_pool_size='0' SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target='0' SCOPE=SPFILE;
ALTER SYSTEM SET shared_pool_size='0' SCOPE=SPFILE;
ALTER SYSTEM SET sga_max_size='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET sga_target='0' SCOPE=SPFILE;
'0 = auto'
Thursday, July 23, 2015
Decommissioning the vCenter Server or a Platform Services Controller
shell.set –enabled True
shell
cd /usr/lib/vmware-vmdir/bin
run
./vdcrepadmin -f showpartners -h vc-psc.example.com -u administrator -w password
./vdcrepadmin -f showservers -h vc-psc.example.com -u administrator -w password
./vdcleavefed -h vc02.nida.local -u administrator -w password
cmsso-util unregister --node-pnid vcenter.example.com --username administrator@vsphere.local --passwd password
shell
cd /usr/lib/vmware-vmdir/bin
run
./vdcrepadmin -f showpartners -h vc-psc.example.com -u administrator -w password
./vdcrepadmin -f showservers -h vc-psc.example.com -u administrator -w password
./vdcleavefed -h vc02.nida.local -u administrator -w password
cmsso-util unregister --node-pnid vcenter.example.com --username administrator@vsphere.local --passwd password
Wednesday, July 22, 2015
Privilege on Oracle Database for vCenter 6.0
Create ROLEs
create role vc_admin_role;
create user vcenter identified by oracle account unlock;
grant resource to vcenter;
grant connect to vcenter;
grant connect to vc_admin_role;
grant resource to vc_admin_role;
grant create view to vc_admin_role;
grant create sequence to vc_admin_role;
grant create table to vc_admin_role;
grant create materialized view to vc_admin_role;
grant execute on dbms_lock to vc_admin_role;
grant select on dba_lock TO vc_admin_role;
grant execute on dbms_job to vc_admin_role;
grant select on dba_tablespaces to vc_admin_role;
grant select on dba_temp_files to vc_admin_role;
grant select on dba_data_files to vc_admin_role;
grant unlimited tablespace to vc_admin_role;
grant select on v_$session TO vc_admin_role;
grant select on v_$system_event TO vc_admin_role;
grant select on v_$sysmetric_history TO vc_admin_role;
grant select on v_$sysstat TO vc_admin_role;
grant select on dba_data_files TO vc_admin_role;
grant select on v_$loghist TO vc_admin_role;
create role vc_admin_role;
create user vcenter identified by oracle account unlock;
grant resource to vcenter;
grant connect to vcenter;
grant connect to vc_admin_role;
grant resource to vc_admin_role;
grant create view to vc_admin_role;
grant create sequence to vc_admin_role;
grant create table to vc_admin_role;
grant create materialized view to vc_admin_role;
grant execute on dbms_lock to vc_admin_role;
grant select on dba_lock TO vc_admin_role;
grant execute on dbms_job to vc_admin_role;
grant select on dba_tablespaces to vc_admin_role;
grant select on dba_temp_files to vc_admin_role;
grant select on dba_data_files to vc_admin_role;
grant unlimited tablespace to vc_admin_role;
grant select on v_$session TO vc_admin_role;
grant select on v_$system_event TO vc_admin_role;
grant select on v_$sysmetric_history TO vc_admin_role;
grant select on v_$sysstat TO vc_admin_role;
grant select on dba_data_files TO vc_admin_role;
grant select on v_$loghist TO vc_admin_role;
Tuesday, July 21, 2015
Duplicate oracle database same host and change Instance NAME
Instance DUBDB
FULL Backup on Target first
@create local tns tnsname.ora
DUPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DUPDB)
)
)
@create service listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = DUPDB)
(ORACLE_HOME = /u01/oracle/product/11.2.0.2/dbhome_1)
(GLOBAL_DBNAME = DUPDB)
)
)
@create pfile for dupplicate database
add line
ORCL.__db_cache_size=260046848
ORCL.__java_pool_size=4194304
ORCL.__large_pool_size=4194304
ORCL.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment
ORCL.__pga_aggregate_target=373293056
ORCL.__sga_target=700448768
ORCL.__shared_io_pool_size=0
ORCL.__shared_pool_size=411041792
ORCL.__streams_pool_size=8388608
*.audit_file_dest='/u01/oracle/admin/DUPDB/adump'<---New audit file
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u02/DUPDB/control01.ctl','/u02/DUPDB/control02.ctl'<---new path controlfile
*.db_block_size=8192
*.db_domain=''
*.db_name='DUPDB'<---New Instance DB
*.db_recovery_file_dest='/u02/DUPDB/f_recovery'<---New fast_recovery_area
*.db_recovery_file_dest_size=4259315712
*.diagnostic_dest='/u01/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=1073741824
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.LOG_FILE_NAME_CONVERT='/u02/oradata/ORCL/','/u02/DUPDB/'<---add for convert datafile from original path to new path
*.DB_FILE_NAME_CONVERT='/u02/oradata/ORCL/redo','/u02/DUPDB/redo'<---add for convert redolog from original path to new path
**** for Multiple path Oracle datafile
*.LOG_FILE_NAME_CONVERT='/data1/oradata/ORCLG','/data1/oradata/DUPDB',
'/data2/oradata/ORCL','/data2/oradata/DUPDB',
'/data3/oradata/ORCL','/data3/oradata/DUPDB'
*.DB_FILE_NAME_CONVERT='/data1/oradata/ORCL','/data1/oradata/DUPDB',
'/data2/oradata/ORCL','/data2/oradata/DUPDB',
'/data3/oradata/ORCL','/data3/oradata/DUPDB',
'/data4/oradata/ORCL','/data4/oradata/DUPDB',
'/data5/oradata/ORCL','/data5/oradata/DUPDB',
'/data6/oradata/ORCL','/data6/oradata/DUPDB'
@create oracle password file $ORACLE_HOME/dbs
orapwd file='orapwINSTANCE_NAME' password=oracle entries=3
orapwd file='orapwDUPDB' password=oracle entries=3
@start LISTENER
lsnrctl start LISTENER
@START AUXILIARY database
export ORACLE_SID=DUPDB
sqlplus / as sysdba
startup pfile='initDUBDB.ora' nomount;
@START TARGET database
export ORACLE_SID=ORCL
sqlplus / as sysdba
startup mount;
@Connect to RMAN on TARGET instance
rman target / auxiliary sys/oracle@DUPDB
@rman_duplicate.sql script
RUN{
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE to "DUPDB";
release channel aux1;
release channel aux2;
release channel aux3;
}
FULL Backup on Target first
@create local tns tnsname.ora
DUPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DUPDB)
)
)
@create service listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = DUPDB)
(ORACLE_HOME = /u01/oracle/product/11.2.0.2/dbhome_1)
(GLOBAL_DBNAME = DUPDB)
)
)
@create pfile for dupplicate database
add line
ORCL.__db_cache_size=260046848
ORCL.__java_pool_size=4194304
ORCL.__large_pool_size=4194304
ORCL.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment
ORCL.__pga_aggregate_target=373293056
ORCL.__sga_target=700448768
ORCL.__shared_io_pool_size=0
ORCL.__shared_pool_size=411041792
ORCL.__streams_pool_size=8388608
*.audit_file_dest='/u01/oracle/admin/DUPDB/adump'<---New audit file
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u02/DUPDB/control01.ctl','/u02/DUPDB/control02.ctl'<---new path controlfile
*.db_block_size=8192
*.db_domain=''
*.db_name='DUPDB'<---New Instance DB
*.db_recovery_file_dest='/u02/DUPDB/f_recovery'<---New fast_recovery_area
*.db_recovery_file_dest_size=4259315712
*.diagnostic_dest='/u01/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=1073741824
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.LOG_FILE_NAME_CONVERT='/u02/oradata/ORCL/','/u02/DUPDB/'<---add for convert datafile from original path to new path
*.DB_FILE_NAME_CONVERT='/u02/oradata/ORCL/redo','/u02/DUPDB/redo'<---add for convert redolog from original path to new path
**** for Multiple path Oracle datafile
*.LOG_FILE_NAME_CONVERT='/data1/oradata/ORCLG','/data1/oradata/DUPDB',
'/data2/oradata/ORCL','/data2/oradata/DUPDB',
'/data3/oradata/ORCL','/data3/oradata/DUPDB'
*.DB_FILE_NAME_CONVERT='/data1/oradata/ORCL','/data1/oradata/DUPDB',
'/data2/oradata/ORCL','/data2/oradata/DUPDB',
'/data3/oradata/ORCL','/data3/oradata/DUPDB',
'/data4/oradata/ORCL','/data4/oradata/DUPDB',
'/data5/oradata/ORCL','/data5/oradata/DUPDB',
'/data6/oradata/ORCL','/data6/oradata/DUPDB'
@create oracle password file $ORACLE_HOME/dbs
orapwd file='orapwINSTANCE_NAME' password=oracle entries=3
orapwd file='orapwDUPDB' password=oracle entries=3
@start LISTENER
lsnrctl start LISTENER
@START AUXILIARY database
export ORACLE_SID=DUPDB
sqlplus / as sysdba
startup pfile='initDUBDB.ora' nomount;
@START TARGET database
export ORACLE_SID=ORCL
sqlplus / as sysdba
startup mount;
@Connect to RMAN on TARGET instance
rman target / auxiliary sys/oracle@DUPDB
@rman_duplicate.sql script
RUN{
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE to "DUPDB";
release channel aux1;
release channel aux2;
release channel aux3;
}
Monday, July 20, 2015
Thursday, July 9, 2015
Samba in Oracle Solaris 10
Samba in Oracle Solaris 10
- check package
Docapps# pkginfo -x | grep -i samba
SUNWsmbac samba - A Windows SMB/CIFS fileserver for UNIX (client)
SUNWsmbar samba - A Windows SMB/CIFS fileserver for UNIX (Root)
SUNWsmbau samba - A Windows SMB/CIFS fileserver for UNIX (Usr)
- check samba config file
Docapps# pkgchk -l SUNWsmbar | grep conf-example
Pathname: /etc/sfw/smb.conf-example
- check stage samba
Docapps# svcs -a | grep samba
disable 10:31:59 svc:/network/samba:default
- edit share path on /etc/sfw/smb.conf
cp /etc/sfw/smb.conf-example /etc/sfw/smb.conf
exp:
[myshare]
comment = My Share
valid users = test
path = /u01/app/test
writeable = no
guest ok = yes
- chmod smb.conf file to read only
chmod 0444 /etc/sfw/smb.conf
- check state samba service and start service
Docapps# svcadm disable samba
svcs -a | grep samba
Docapps# svcadm enable samba
svcs -a | grep samba
online 10:42:04 svc:/network/samba:default
-set passwd for samba user
Docapps#/usr/sfw/bin/smbpasswd -a test
password : 123456
- test connect on MS windows
net use O: \\192.168.1.20\myshare
- check package
Docapps# pkginfo -x | grep -i samba
SUNWsmbac samba - A Windows SMB/CIFS fileserver for UNIX (client)
SUNWsmbar samba - A Windows SMB/CIFS fileserver for UNIX (Root)
SUNWsmbau samba - A Windows SMB/CIFS fileserver for UNIX (Usr)
- check samba config file
Docapps# pkgchk -l SUNWsmbar | grep conf-example
Pathname: /etc/sfw/smb.conf-example
- check stage samba
Docapps# svcs -a | grep samba
disable 10:31:59 svc:/network/samba:default
- edit share path on /etc/sfw/smb.conf
cp /etc/sfw/smb.conf-example /etc/sfw/smb.conf
exp:
[myshare]
comment = My Share
valid users = test
path = /u01/app/test
writeable = no
guest ok = yes
- chmod smb.conf file to read only
chmod 0444 /etc/sfw/smb.conf
- check state samba service and start service
Docapps# svcadm disable samba
svcs -a | grep samba
Docapps# svcadm enable samba
svcs -a | grep samba
online 10:42:04 svc:/network/samba:default
-set passwd for samba user
Docapps#/usr/sfw/bin/smbpasswd -a test
password : 123456
- test connect on MS windows
net use O: \\192.168.1.20\myshare
Subscribe to:
Posts (Atom)
ALCATEL 6900
write memory copy running certified reload from working no rollback-timeout
-
SET LLDP System NAME: system name ALL-Uplink system location SIAM-FL11 SHOW LLDP Configure: show lldp config or show lldp local-syste...
-
grant execute on utl_http to wc grant execute on dbms_lock to wc; BEGIN DBMS_NETWORK_ACL_ADMIN.create_acl ( acl => ...
-
:system view system-view or sys :show all config dis current-configuration :create vlan vlan vlan_number :show ip interface ...